当前位置:首页 > C# > C#修改图片分辨率

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;  
            }  
        }  

除特别注明外,本站所有文章均为视觉电子科技原创,转载请注明出处来自https://feelsight.cn/post/38.html

赞 (2

发表评论

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

分享:

支付宝

微信