简体   繁体   English

如何在C#中将位图图像转换为32位到16位的颜色质量

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

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. 我们有两个imagew,第一个图像是在WindowsXP中捕获的,用于32位色彩质量,同样在WindowsXP中捕获16bit色彩质量。两个图像都保存为位图图像。但在比较两者时,我们观察到哈希值不同。 Here we are planning to implement the C# code to convert the 32bit color quality image to 16bit color quality image. 在这里,我们计划实现C#代码,将32位色彩质量图像转换为16位色彩质量图像。

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 bmp - 将具有16位质量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM