用C#剪切一张图片 [英] cut a piece of a picture in c#
本文介绍了用C#剪切一张图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在c#中剪切一张图片.
我该怎么办?
请帮帮我.
谢谢.
i want to cut a piece of a picture in the c#.
what can i do?
please help me.
thanks.
推荐答案
尝试:
public static Bitmap Extract(Bitmap src, Rectangle section)
{
Bitmap bmp = new Bitmap(section.Width, section.Height);
using (Graphics g = Graphics.FromImage(bmp))
{
g.DrawImage(src, 0, 0, section, GraphicsUnit.Pixel);
}
return bmp;
}
这篇关于用C#剪切一张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文