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; } }
- 随机文章
- 热门文章
- 热评文章
- Linux下python2.7安装pip
- ESP8266在Eclipse下设置编译模式(有boot和无boot)
- 物联网 WIFI 一键配置原理(smartconfig) ESP8266/QCA4004
- 内存堆和栈的区别
- 乐高EV3与单片机蓝牙通讯
- 开关电源拓扑结构概述(降压,升压,反激、正激)
- 电脑微信双开,多开
- c# 全局鼠标事件