2

我用意图启动相机

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);

但是得到的缩略图很小,我如何得到完整的位图?

4

1 回答 1

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); 
于 2012-03-14T11:11:08.747 回答