0

I used crop intent to add image cropping functionality to my application. I used TouchImageView as my image view. After cropping and setting the cropped image to the TouchImageView, the image is blurred. Before adding this crop functionality, I have done this to get the image data from camera and set it to TouchImageView as:

        Uri imageUri;
        TouchImageView myTVF = (TouchImageView) findViewById(R.id.img);
        imageUri = data.getData();
        myTVF.setImageURI(imageUri);

But now, in order to use crop intent, after image capture followed by cropping, I am using this to set the cropped image to my TouchImageView:

           (....)
            else if(requestCode == PIC_CROP){
            Bundle extras = data.getExtras();
            Bitmap thePic= extras.getParcelable("data");
            myTVF.setImageBitmap(thePic);

But, the image set is now blurry. Can anyone help me with this? (I am also trying to use other available cropping libraries.. but I just wanted to know why this is not working)

Shravan DG
  • 527
  • 1
  • 5
  • 16

1 Answers1

0

I assumed you were calling startActivity() on an Intent with an action of com.android.camera.action.CROP.

There is article saying that android doesn't not have crop intent. So I recommend to use another good 3rd party library.

Burhanuddin Rashid
  • 5,260
  • 6
  • 34
  • 51
  • Thank you for your response! I have tried using that library but I was not able to follow his steps! Can you help me with it? Where should I include this line? : Crop.of(inputUri, outputUri).asSquare().start(activity). I want to crop the image as soon as I capture image from camera in my app. – Shravan DG Sep 07 '16 at 17:16
  • @ShravanDG You can call it after crop finish. Usually I catch inside `protected void onActivityResult(int requestCode, int resultCode, Intent data)`, check the resultCode with `if (resultCode == RESULT_OK && requestCode == Crop.REQUEST_PICK)`. There ya go, you can put `Crop.of(inputUri, outputUri).asSquare().start(activity)` there. – Jimmy Chandra Sep 08 '16 at 00:35