我正在开发一款安卓应用程序,它可以捕获图像,并使用opencv函数进行处理,然后返回处理结果图像并在图像视图中显示出来。为了能够对捕获的图像进行处理,我该如何将其暂时保存起来呢?
public class Camera extends Activity
{
ImageView imgview;
Bitmap Bmp;
final static int cameraData=0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.camera);
imgview= (ImageView) findViewById(R.id.imgview);
Intent i=new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i,cameraData);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK)
{
Bundle extras=data.getExtras();
Bmp=(Bitmap)extras.get("data");
imgview.setImageBitmap(Bmp);
}
}
}