GDI DIB Engine Failing in 24 Bits Per Pixel Color

Harold L Hunt II huntharo@msu.edu
Wed Jan 22 22:08:00 GMT 2003


Yup, the Stride, or Pitch, of the scanlines is padded to 32 bit word
boundaries.  That value is identical to the value used by the DirectDraw
engine in 24 bits per pixel color mode... which it should be since
DirectDraw uses a DIB for their Surface objects.

As for the colormap... the MSDN docs are wishy-washy on that... the colormap
for a non-pallettized DIB has to have the first three entries set to the
color masks.  It is not clear if the rest of the map has to have anything in
it... we never have put anything in it, and I believe that other
documentation (since MSDN is sometimes blantantly wrong) seems to suggest
that you don't have to do anything for the rest of the color map since you
aren't really using one.

Unfortunately I am not on a machine that supports 24 bits per pixel right
now, so I am unable to test any ideas.  Frustrating :(

Harold

-----Original Message-----
From: cygwin-xfree-owner@cygwin.com
[mailto:cygwin-xfree-owner@cygwin.com]On Behalf Of Benjamin Riefenstahl
Sent: Wednesday, January 22, 2003 2:01 PM
To: cygwin-xfree@cygwin.com
Subject: Re: GDI DIB Engine Failing in 24 Bits Per Pixel Color


Hi Harold,

"Harold L Hunt II" <huntharo@msu.edu> writes:
> I recall seeing somewhere that the GDI DIB documentation is wrong
> when it comes to 24 bit DIBs and that instead of the pixels being
> packed, they are actually aligned on 32 bit word boundaries, just
> like a 32 bit DIB.  Am I crazy?  Did I just dream seeing this?

A short look into the docs, without actually trying anything out, says
that scanlines must be padded to a 32-bit boundary (for all data types
actually, not just 24 bits).  Does the code do that?  The docs also
say, that the colormap can be used for optimization, so it must be
initialized, even if empty.

Just some thoughts, benny



More information about the Cygwin-xfree mailing list