在C#中转换位图PixelFormats

在C#中转换位图PixelFormats,第1张

在C#中转换位图PixelFormats

马虎,对于GDI +并不罕见。可以解决此问题:

Bitmap orig = new Bitmap(@"c:temp24bpp.bmp");Bitmap clone = new Bitmap(orig.Width, orig.Height,    System.Drawing.Imaging.PixelFormat.Format32bppPArgb);using (Graphics gr = Graphics.FromImage(clone)) {    gr.DrawImage(orig, new Rectangle(0, 0, clone.Width, clone.Height));}// Dispose orig as necessary...


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5114180.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-17
下一篇2022-11-17

发表评论

登录后才能评论

评论列表(0条)

    保存