简体   繁体   中英

Cropped image is blurry in android

I am trying to crop an image that is selected from gallery in android as follows.

Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(photoUri, "image/*");         
intent.putExtra("outputX", 400);
intent.putExtra("outputY", 300);
intent.putExtra("aspectX", 4);
intent.putExtra("aspectY", 3);
intent.putExtra("scale", true);
intent.putExtra("return-data", true);
startActivityForResult(intent, RESULT_CROP);

When I try to set the outputX and outputY to 800, 600 it doesn't work. The above code works fine but the cropped image looks blurred. Can anyone please suggest how to crop the image without making it too blurry. Thanks.

You should use one of the available libraries instead. For instance: https://github.com/jdamcd/android-crop

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM