C#改变图片大小
byte
[] buffer =
new
byte
[1];
//Byte转为Image对象
MemoryStream ms =
new
MemoryStream(buffer);
Image image = System.Drawing.Image.FromStream(ms);
//设置画布,绘画新图片
Bitmap b =
new
Bitmap(200, 200);
Graphics g = Graphics.FromImage((System.Drawing.Image)b);
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
//绘制图像
g.DrawImage(image, 0, 0, 200, 200);
g.Dispose();
//保存图片
b.Save(
"aaaaaaaaa"
);
赞 (0)