1
我想保存拍攝的圖像在GridView的我的應用程序的內存和觀點,但是當我捕捉圖像allication是死機我該怎麼辦?我如何解碼捕獲的圖像?我想保存拍攝的圖像在我的應用程序存儲器(「數據/數據/ com.myexample /文件\ CameraRoll \」);我該怎麼辦?請幫我如何解碼並保存捕捉圖像,並顯示在GridView控件
Private final int CAMERA_PICTURE=1;
public final String IMAGE_CAPTURE_NAME=System.currentTimeMillis()+".jpeg";
File Cameraroll =new file(getFileDir(),"CameraRoll");
if(CameraRoll.esixts() && CameraRoll.isDirectory())
{
}
else
{
CameraRoll.mkdir
}
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File
(cameraRoll+"/",IMAGE_CAPTURE_NAME))););
startActivityForResult(intent, Camera_PICTURE);
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode,resultCode,data);
if (requestCode == Camera_PICTURE) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
}
}
沒有這個工作? – 2013-04-24 11:49:41