如何设置Android的裁剪图像大小固定? [英] how to set fixed size of cropped images in android?
本文介绍了如何设置Android的裁剪图像大小固定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序,我们使用的是农作物图像,但不想作物面积为可调整大小。在图像中,我不想让红色圆圈下的管制,应该固定在相同尺寸
In my application, we are using the crop image but don't want crop area to be resizable. In the image, I don't want those controls under the red circles, it should be fixed at the same size
intent.setData(mImageCaptureUri);
intent.putExtra("outputX", 200);
intent.putExtra("outputY", 200);
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
intent.putExtra("scale", true);
intent.putExtra("return-data", true);
推荐答案
我终于得到了答案
public void cropCapturedImage(Uri picUri)
{
// call the standard crop action intent
Intent cropIntent = new Intent("com.android.camera.action.CROP");
cropIntent.setDataAndType(picUri , "image/*");
cropIntent.putExtra("crop" , "true");
cropIntent.putExtra("return-data" , true);
startActivityForResult(cropIntent , 2);
}
这篇关于如何设置Android的裁剪图像大小固定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文