PDA

View Full Version : How to check at how many bits I am displying.



PeterHer
01-31-2009, 05:18 AM
Hi All,

Is it possible to check at how many bits I am displaying.
I want to display a 16 bit gray image but I think it is only 8 bits.

I am use Delphi:

WordBuffer: Array of Word;

CreateRenderingContext(MyWindow.DC, [opDoubleBuffered], 32, 24, 8, 64, 4, 0);

// Create 1 Textures
glGenTextures(1, addr(MapTex));
// Bind The Texture
glBindTexture(GL_TEXTURE_2D, MapTex);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, ImageWidth,
ImageHeight, 0,GL_LUMINANCE, GL_UNSIGNED_SHORT, addr(WordBuffer[0]));

Any ideas?

I have WinXP Pro, GeForge 8600 GT and a 16.7 M color monitor.

Thanks.

Peter.

wedge
02-02-2009, 10:16 AM
yup
use GetPixelFormat to get the RC used by your program, and get the color depth of this Pixel format with DescribePixelFormat.(win)