1

我有这个用于裁剪图像的代码:

Intent cropIntent = new Intent("com.android.camera.action.CROP");
    //indicate image type and Uri
cropIntent.setDataAndType(picUri, "image/*");
    //set crop properties
cropIntent.putExtra("crop", "true");
    //indicate aspect of desired crop
cropIntent.putExtra("aspectX", 1);
cropIntent.putExtra("aspectY", 1);
    //indicate output X and Y
cropIntent.putExtra("outputX", 256);
cropIntent.putExtra("outputY", 256);

    //start the activity - we handle returning in onActivityResult
startActivityForResult(cropIntent, PIC_CROP);

但我不想让用户更改裁剪器的大小。我希望用户只需将裁剪矩形移动到图像上并裁剪图像的预定义大小(宽度 x 高度)。

4

0 回答 0