7

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.

l-l
  • 3,804
  • 6
  • 36
  • 42

1 Answers1

0

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

BoD
  • 10,838
  • 6
  • 63
  • 59