C#数字图像处理之图像缩放的方法
时间:2021-04-03 07:46:00|栏目:.NET代码|点击: 次
本文实例讲述了C#数字图像处理之图像缩放的方法。分享给大家供大家参考。具体如下:
//定义图像缩放函数
private static Bitmap ZoomP(Bitmap a, float s, float v)
{
Bitmap bmp = new Bitmap((int)(a.Width * s), (int)(a.Height * v), System.Drawing.Imaging.PixelFormat.Format24bppRgb);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color .White );
g.ScaleTransform(s,v);
g.DrawImage(a,0,0,a.Width ,a.Height );
a = bmp;
return a;
}
希望本文所述对大家的C#程序设计有所帮助。
上一篇:asp.net 安全的截取指定长度的html或者ubb字符串
栏 目:.NET代码
本文标题:C#数字图像处理之图像缩放的方法
本文地址:http://www.codeinn.net/misctech/93445.html






