//CROP INTENT
private void doCropping
{
Intent cropIntent = new Intent("com.android.camera.action.CROP");
cropIntent.setDataAndType(selectedImageUri, "image/*");
cropIntent.putExtra("crop", "true");
cropIntent.putExtra("aspectX", 16);
cropIntent.putExtra("aspectY", 9);
cropIntent.putExtra("aspectX", 1);
cropIntent.putExtra("aspectY", 1);
cropIntent.putExtra("return-data", true);
try {
((Activity) context).startActivityForResult(cropIntent, code);
} catch (Exception e) {
}
}
//CROP RESULT
private void resultOnCropOkOfGallary(Intent data) {
Bundle extras2 = data.getExtras();
this.bitmap = extras2.getParcelable("data");
if (this.bitmap != null) {
//ivPicture is Imageview.
ivPicture.setImageBitmap(bitmap);
}
}
裁剪完成后我得到了图像。但它使图像质量低。 我在imageview上设置了模糊图像。请解决。谢谢。
答案 0 :(得分:1)