C#修改图片分辨率
public static Bitmap KiResizeImage(Bitmap bmp, int newW, int newH)
{
try
{
Bitmap b = new Bitmap(newW, newH);
Graphics g = Graphics.FromImage(b);
// 插值算法的质量
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawImage(bmp, new Rectangle(0, 0, newW, newH), new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel);
g.Dispose();
return b;
}
catch
{
return null;
}
}
- 随机文章
- 热门文章
- 热评文章
- Font Awesome 一套绝佳的图标字体库和CSS框架(奥森图标)
- labVIEW调用C# dll 步骤
- UDP穿透NAT的原理与实现(UDP“打洞”原理)
- C#图片处理示例(裁剪,缩放,清晰度,水印)
- 安装包制作工具 SetupFactory使用1 详解
- 安装包制作工具 SetupFactory使用2 API清单
- Linux下python2.7安装pip
- HTTP请求头详解




