Crop an image by mouse draging shape. not in rectangle shape. If I am click and drag the mouse in a particular shape crop image开发者_如何学编程 in that shape
Your final image can obviously only be a rectangle and have a height and width.
You would need to keep coordinates of the shape you "draw/drag" and then somehow use this as a mask to set the pixels outside this area to a specific "empty/background" colour or transparent if the image type supports it.
Does this answer your question?
this might help you:
Image img = Imager.Crop(sourceImage, new Rectangle(x, y, width, height));
http://imager.codeplex.com/
instead of new Rectangle
you do something else
精彩评论