如何从相机获取全尺寸位图?

时间:2012-03-14 11:07:35

标签: android bitmap android-camera-intent

我曾使用意图启动相机

Intent cameraIntent = new Intent( 
android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
getParent().startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST); 

和onActivityResult()使用

Bitmap thumbnail = (Bitmap) data.getExtras().get("data"); 
Save_to_SD (thumbnail, filename);

但是获取缩略图的尺寸很小,我如何获得完整的位图?

1 个答案:

答案 0 :(得分:4)

将输出保存到某些uri并从那里获取

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
                mImageCaptureUri1 = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),
                        "tmp_avatar_" + String.valueOf(System.currentTimeMillis()) + ".jpg"));

                cameraIntent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mImageCaptureUri1);                     
                cameraIntent.putExtra("return-data", true);
                startActivityForResult(cameraIntent, CAMERA_REQUEST);