【问题标题】:How to convert bitmap image with 32bit to 16bit color quality in C#如何在 C# 中将具有 32 位颜色质量的位图图像转换为 16 位颜色质量
【发布时间】:2011-03-03 16:47:02
【问题描述】:
我们有两个图像,第一个图像是在 WindowsXP 中捕获的
32 位颜色质量和在 Windows XP 中捕获的 16 位颜色质量相同。两个图像都已保存为位图图像。但是在比较两者时,我们观察到哈希值不同。这里我们计划实现C#代码,将32bit彩色质量图像转换为16bit彩色质量图像。
有没有人研究过这种位图图像比较问题,对此方面的任何输入将不胜感激。
提前非常感谢。
【问题讨论】:
标签:
c#
visual-studio-2008
image
【解决方案1】:
尝试使用下一个
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 - 将具有 16 位质量