Cropping an image in any shape
2 answers
Your final image can obviously only be a rectangle and have a height and width.
You will need to store the coordinates of the shape you are drawing / dragging and then somehow use it as a mask to set the pixels outside of that area to a specific "blank / background" color or transparent if the image type supports it.
Does this answer your question?
0
source to share