开发者

C#. Crop image on N rectangles

I need to crop image on N rec开发者_JAVA百科tangles.

Condition for all rectangles:

Rectangle's width = X

Rectangle's height = X/2

Any algorithm ?


This can help you:

private static Image cropImage(Image img, Rectangle cropArea)
{
   Bitmap bmpImage = new Bitmap(img);
   Bitmap bmpCrop = bmpImage.Clone(cropArea,
   bmpImage.PixelFormat);
   return (Image)(bmpCrop);
}

I found a more complex but complete example here:

http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/e0c30a26-60da-457d-a217-ba95650deec8

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜