Cropping an image in any shape

Crop the image with the mouse. not in the shape of a rectangle. If I click and drag the mouse to a certain shape crop image in this shape

+2


source to share


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


this might help you:

Image img = Imager.Crop(sourceImage, new Rectangle(x, y, width, height));

      



http://imager.codeplex.com/

instead new Rectangle

you do something else

0


source







All Articles