PRB: Bad Colors or GPF Using Logical Palettes w/ DIB Sections

Last reviewed: September 27, 1995
Article ID: Q137232
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK)

SYMPTOMS

The program displays the wrong colors or causes a general protection (GP) fault when using a DIB section and a custom palette in a memory DC.

CAUSE

There is a problem in Windows 95 where an internal palette structure is not set up until the palette is selected into a screen DC.

RESOLUTION

If you use logical palettes with bitmaps created by CreateDIBSection, select the palette into a screen DC when the palette is created. Then the palette can be used normally with Screen DCs as well as with DIB sections.

STATUS

Microsoft is researching this behavior and will post new information here in the Microsoft Knowledge Base when it becomes available.


Additional reference words: 4.00 Windows 95 SelectObject SelectPalette
CreatePalette CreateCompatibleDC GPF
KBCategory: kbgraphic kbprb
KBSubcategory: GdiPal


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.