我有这段代码:
public static Bitmap ResizeImage(Bitmap imgToResize, Size size)
{
try
{
Bitmap b = new Bitmap(size.Width, size.Height);
using (Graphics g = Graphics.FromImage((Image)b))
{
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.DrawImage(imgToResize, 0, 0, size.Width, size.Height);
}
return b;
}
catch
{
throw;
}
}
当我调用该函数时,例如:ResizeImage(bmp, 我该如何设置尺寸?
答案 0 :(得分:1)
:
ResizeImage(bmp, new Size(150, 150));