burhanrashid52 / PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
MIT License
4.13k stars 991 forks source link

I Impliment Crop Functionality With useing External Library -> implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' #299

Closed Kishan7up closed 3 years ago

Kishan7up commented 3 years ago

You Can Use This Library In Tap Of Upload Image Case : implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'

  1. Manifest :

  2. Add This Line in Switch-case : PICK_REQUEST/ CAMERA_REQUEST: CropImage.activity(uri) .setGuidelines(CropImageView.Guidelines.ON) .start(this);

  3. if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) { CropImage.ActivityResult result = CropImage.getActivityResult(data); if (resultCode == RESULT_OK) { Uri resultUri = result.getUri(); Bitmap bitmap = null; try { bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), resultUri); mPhotoEditorView.getSource().setImageBitmap(bitmap);

            } catch (IOException e) {
                e.printStackTrace();
            }
        } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
            Exception error = result.getError();
        }
    }
burhanrashid52 commented 3 years ago

Thanks for the issue. I will link this to #79 and will close this one.

sahil0289 commented 2 years ago

You Can Use This Library In Tap Of Upload Image Case : implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'

  1. Manifest :
  2. Add This Line in Switch-case : PICK_REQUEST/ CAMERA_REQUEST: CropImage.activity(uri) .setGuidelines(CropImageView.Guidelines.ON) .start(this);
  3. if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) { CropImage.ActivityResult result = CropImage.getActivityResult(data); if (resultCode == RESULT_OK) { Uri resultUri = result.getUri(); Bitmap bitmap = null; try { bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), resultUri); mPhotoEditorView.getSource().setImageBitmap(bitmap);
           } catch (IOException e) {
               e.printStackTrace();
           }
       } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
           Exception error = result.getError();
       }
    }

How did you crop image after highlighting or writing text??