【发布时间】:2012-06-14 04:21:08
【问题描述】:
我正在通过单击按钮打开相机应用程序。并在下一个活动中显示拍摄的照片。但拍摄的照片旋转了 90 度。当我在捕获图像后在视图中显示图像时,它的方向始终是横向的。为什么在人像模式下拍摄照片时,照片没有以人像模式显示?
点击按钮:
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(APP_DIR+"/latest.png")));
startActivityForResult(i, CAPTURE_PHOTO_CONSTANT);
onActvityresult 内部:
bmp = BitmapFactory.decodeFile(APP_DIR+"/latest.png");
startActivity(new Intent(this, DisplayActivity.class));
显示拍摄的照片:
photoViewRelativeLayout.setBackgroundDrawable(new BitmapDrawable(getResources(), CaptureActivity.bmp));
【问题讨论】: