Android com.android.camera.action.CROP修复最小尺寸

时间:2013-09-19 12:46:35

标签: android image android-intent photo crop

我需要将图像裁剪成方形。我使用那个功能:

private void crop(Uri imageUri) {
    File photoGallery = new File(Environment.getExternalStorageDirectory(), "temp_image.jpg");
    checkImageSize(photoGallery);
    Intent cropIntentGallery = new Intent("com.android.camera.action.CROP");
    cropIntentGallery.setDataAndType(imageUri, "image/*");
    cropIntentGallery.putExtra("crop", true);
    cropIntentGallery.putExtra("aspectX", 1);
    cropIntentGallery.putExtra("aspectY", 1);
    cropIntentGallery.putExtra("outputX", PHOTO_SIZE);
    cropIntentGallery.putExtra("outputY", PHOTO_SIZE);
    cropIntentGallery.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoGallery));
    startActivityForResult(cropIntentGallery, REQ_EDIT_CAMERA);
}

它会打开裁剪活动,但我可以更改X和Y尺寸。 我需要的是修复最小尺寸,因此如果图像是以横向模式制作的 - 用户将能够剪切左边缘和/或右边缘(如果是纵向 - 顶部或/和底部边缘)。 是否有一些额外的参数可以做到这一点?

顺便说一句,在哪里我可以找到所有可能的意图附加列表? (如:“aspectX”,“outputX”......)

0 个答案:

没有答案