虽然在2.X中指定了MediaStore.EXTRA_OUTPUT,但是从Camera检索到的小图片

时间:2010-05-07 09:39:38

标签: android camera mediastore

我只是不明白:当我有意图使用相机并指定输出文件时,许多设备上返回的图像总是非常小(例如Motorola Milestone 2.1,HTC Desire 2.1,Emulator 2.1,Emulator 2.0.1)但并非所有(例如Nexus One)。这是我用来启动相机应用程序的方法:

private final static String TEMP_PHOTO_FILE = Environment.getExternalStorageDirectory() + "/TEMP_PHOTO.JPG";  
private final static int REQUEST_CAMERA = 0;  
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(TEMP_PHOTO_FILE)));  
startActivityForResult(intent, REQUEST_CAMERA);

拍摄完图像后,我会在onActivityResult(int requestCode, int resultCode, Intent data)中获取结果:

if (requestCode == REQUEST_CAMERA && resultCode == RESULT_OK) {  
    String photo = MediaHandler.moveFile(TEMP_PHOTO_FILE, MediaHandler.SDCARD_IMAGE_PATH, System.currentTimeMillis());  
    BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();  
    // bitmapOptions.inSampleSize = 6;  
    imgBitmap = BitmapFactory.decodeFile(photo, bitmapOptions);  

位图非常小,我想知道为什么会这样。我知道用来正常工作 有没有人有同样的问题,甚至暗示如何解决这个问题?

谢谢,
Steff

1 个答案:

答案 0 :(得分:1)