开发者

Cropping an image in any shape

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜