【C#】改变图片大小

 

/// <summary>
/// 改变图像大小
/// </summary>
public static Image ReSizeImage(Image img, Size size)
{
    Bitmap bitmap = new Bitmap(size.Width, size.Height);
    Graphics g = Graphics.FromImage(bitmap);
    g.InterpolationMode = InterpolationMode.HighQualityBicubic;
    g.DrawImage(img, 0, 0, bitmap.Width, bitmap.Height);
    g.Dispose();
    return bitmap;
}

 

相关推荐
©️2020 CSDN 皮肤主题: 精致技术 设计师:CSDN官方博客 返回首页