【发布时间】:2011-10-19 20:38:03
【问题描述】:
我有一个应用程序,用户可以通过给自己拍照或从图库中挑选一张照片来设置自己的头像。我在其他应用程序中看到该用户在选择图像后会显示一个视图,用户可以在该视图中“绘制”一个矩形,选择他想用作头像的图像区域。 我想在我的应用程序中包含这种可能性。拍照后怎么办?
谢谢!
编辑:
我正在尝试这样做,但它会打开图片库而不是相机:
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.setType("image/*");
cameraIntent.putExtra("crop", "true");
cameraIntent.putExtra("scale", "true");
cameraIntent.putExtra("outputX", 100);
cameraIntent.putExtra("outputY", 100);
cameraIntent.putExtra("aspectX", 1);
cameraIntent.putExtra("aspectY", 1);
cameraIntent.putExtra("max-width", 30);
cameraIntent.putExtra("max-height", 30);
cameraIntent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(cameraIntent, IMAGEN_CAMARA);
【问题讨论】:
标签: android image-processing crop