开发者

How to convert bitmap image with 32bit to 16bit color quality in C#

开发者 https://www.devze.com 2023-02-15 02:57 出处:网络
We have two imagew, first image is captured in WindowsXP for 32bit color quality and the same is captured in WindowsXP for 16bit color quality.Both images have been saved as bitmap image.But while co

We have two imagew, first image is captured in WindowsXP for 32bit color quality and the same is captured in WindowsXP for 16bit color quality.Both images have been saved as bitmap image.But while comparing both, we are observing that hash values are different. Here we are planning to implement the C# code to convert the 32bit color quality image to开发者_运维知识库 16bit color quality image.

Has anyone have worked on such kind of bitmap image comparison issue, Any inputs on this front would be appreciated.

Many thanks in advance.


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

0

精彩评论

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