开发者

How to convert between PIxelFormat? [duplicate]

开发者 https://www.devze.com 2023-03-06 08:22 出处:网络
This question already has answers here: 开发者_如何学运维 Closed 11 years ago. Possible Duplicate:
This question already has answers here: 开发者_如何学运维 Closed 11 years ago.

Possible Duplicate:

Converting Bitmap PixelFormats in C#

How to convert a Bitmap with different PixelFormat to the PixelFormat.Format32bppArgb format?


Try to use next

var bmp = new Bitmap(yourImage.Width, yourImage.Height, System.Drawing.Imaging.PixelFormat.Format16bppRgb555);
using (var gr = Graphics.FromImage(bmp))
    gr.DrawImage(yourImage, new Rectangle(0, 0, yourImage.Width, yourImage.Height));

bmp - will have 16 bit quality. Specify PixelFormat to what you want

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号