我正在构建一个使用相机拍照的应用程序。下面是我做这件事的源代码:
File file = new File(Environment.getExternalStorageDirectory(),
imageFileName);
imageFilePath = file.getPath();
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
//Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(intent, ACTIVITY_NATIVE_CAMERA_AQUIRE);
在onActivityResult()
方法中,我使用BitmapFactory.decodeStream()
来拾取图像。
当我在Nexus one上运行我的应用程序时,它运行得很好。但当我在三星Galaxy S或HTC Inspire 4G上运行时,图像的方向不正确。
使用肖像模式拍摄
拍摄后的图像预览-SD卡上的真实图像
采用横向模式的
拍摄后的图像预览-SD卡上的真实图像
https://stackoverflow.com/questions/6069122
复制相似问题