如何在Android中设置裁剪图像的固定大小?

如何在Android中设置裁剪图像的固定大小?,android,android-camera,Android,Android Camera,在我的应用程序中,我们使用的是裁剪图像,但不希望裁剪区域的大小可以调整。在图中,我不希望这些控件位于红色圆圈下,它应该固定在相同的大小 intent.setData(mImageCaptureUri); intent.putExtra("outputX", 200); intent.putExtra("outputY", 200); intent.putExtra("aspectX", 1); intent.putExtra("aspectY", 1); intent.putExt

在我的应用程序中,我们使用的是裁剪图像,但不希望裁剪区域的大小可以调整。在图中,我不希望这些控件位于红色圆圈下,它应该固定在相同的大小

 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);
    }

这不是crop公司。它是crop公司,先生,但我需要固定尺寸的corpIn。在这个特定的情况下,这个意图行动,com.android.camera.action.crop,由AOSP摄像头应用程序支持。并非所有设备上都存在该应用程序。缺少此应用程序的设备将不会响应此未记录的意图操作,并且您的应用程序将崩溃。