I need to crop an Image in irregular shape my app, i.e., I select a portion by finger and if I click crop button, the selected portion alone in the Image will be saved in SDCard.
How to achieve it?Answer1:
You have to define a Path for the Shape you want to be cut out.<br /> Then create a rectangle around it an set everything between your shape an the rectangle to transparent (Alpha Channel)
This source here should give you some hints:<br /><a href="https://github.com/lvillani/android-cropimage/blob/develop/src/com/android/camera/CropImage.java" rel="nofollow">https://github.com/lvillani/android-cropimage/blob/develop/src/com/android/camera/CropImage.java</a> <br />Take a look at the onSaveClicked method, line 209Answer2:
Refer this project: <a href="https://github.com/coderush/FlexiCrop" rel="nofollow">https://github.com/coderush/FlexiCrop</a>
It has the code to crop irregular shapes.