我的目的是让用户从库中选择一个图像,然后有一个种植活动上来。但是,我需要定义裁剪掩模被锁定到一定尺寸,然后,用户只需重新定位它,以显示图像的一部分的矩形。
这是如何做到这一点做任何想法?
感谢
-T
解决方案 意向意图=新的意图(Intent.ACTION_GET_CONTENT,空)
.setType(图像/ *)
.putExtra(裁剪,真)
.putExtra(aspectX宽)
.putExtra(aspectY,高度)
.putExtra(outputX宽)
.putExtra(outputY,高度)
.putExtra(规模化,真)
.putExtra(scaleUpIfNeeded,真)
.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(F))
.putExtra(OUTPUTFORMAT,Bitmap.Com pressFormat.JPEG.toString());
My intention is to have the user pick an image from the gallery, then have a cropping activity come up. However, I need the rectangle that defines the cropping mask to be locked to a certain dimension and then the user simply repositions it to display a portion of an image.
Any ideas on how this would be done?
Thanks
-T
解决方案Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null)
.setType("image/*")
.putExtra("crop", "true")
.putExtra("aspectX", width)
.putExtra("aspectY", height)
.putExtra("outputX", width)
.putExtra("outputY", height)
.putExtra("scale", true)
.putExtra("scaleUpIfNeeded", true)
.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f))
.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());