使用C ++显示16位灰度图像 [英] display 16 bit grayscale image using C++

查看:942
本文介绍了使用C ++显示16位灰度图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要显示16位灰度图像,请根据MSDN 
BITMAPINFOHEADER
结构中的文档,"如果$ b的 biCompression 成员$ b BITMAPINFOHEADER 是BI_BITFIELDS, bmiColors 成员包含三个
DWORD 颜色蒙版,用于指定红色,绿色和蓝色组件,分别为每个像素。位图数组中的每个
WORD 表示单个像素。"


0xF800,0x7E0和0x1F用作红色,绿色和蓝色组件和
biClrUsed& biClrImportant 在调用
CreateDIBSection 以呈现内存映射DIB时,根据docuemnt设置为3,但是它仍然会显示当存储器DIB被复制到通过BitBlt()显示DC时,分辨率较低的彩色图像而不是高分辨率灰度图像。


任何人都知道如何在C ++中显示16位灰度图像(不使用.NET中的WPF)?

解决方案


我认为您的问题应该在  Windows Imaging Component(WIC)。我相信他们会比我们更了解这个问题,而且我将这一个移到
论坛。


感谢您的理解,


最好的问候,

杰西


To display 16 bit grayscale image, according to MSDN document in BITMAPINFOHEADER structure, "If the biCompression member of the BITMAPINFOHEADER is BI_BITFIELDS, the bmiColors member contains three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. Each WORD in the bitmap array represents a single pixel."

0xF800, 0x7E0 and 0x1F are used as color masks for red, green and blue components respectively and biClrUsed & biClrImportant both are set to 3 according to the docuemnt when calling CreateDIBSection to render a memory map DIB,  but it still displays much less resolution color image instead of high resolution grayscale image when the memory DIB is copied to display DC via BitBlt().

Anyone knows how to display 16 bit grayscale image in C++(not using WPF in .NET)?

解决方案

Hi ,

I think your issue should be raised in the Windows Imaging Component (WIC). I believe they will know more information of this issue than us, and I will move this one to that forum.

Thanks for your understanding,

Best regards,
Jesse


这篇关于使用C ++显示16位灰度图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆