zoukankan      html  css  js  c++  java
  • 改变图片分辨率

    /// <summary>
            /// 更改背景图片的分辨率
            /// </summary>
            /// <param name="bmp"></param>
            /// <param name="newW"></param>
            /// <param name="newH"></param>
            /// <returns></returns>
            private Bitmap ResizeImage(Image 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;
                }

            }

  • 相关阅读:
    *洛谷P1858 多人背包
    ZOJ3469 Food Delivery
    Hdu5115 Dire Wolf
    Codevs 2765 隐形的翅膀
    Hdu4055 Number String
    Codevs 1300 文件排版
    洛谷 P1412 经营与开发
    Codevs 4357 不等数列
    codevs 3333 高级打字机
    Bzoj 1086: [SCOI2005]王室联邦
  • 原文地址:https://www.cnblogs.com/weiying/p/weiying02_08.html
Copyright © 2011-2022 走看看