PRB: LoadImage Alters Color Table with 256 Color Bitmaps

ID: Q195831


The information in this article applies to:
  • Microsoft Windows NT 4.0
  • Microsoft Windows 2000


SYMPTOMS

When you load a .bmp file with the LoadImage API under Windows NT, the color table of the loaded image might not match the color table of the original .bmp file. Typically, this problem occurs when you load a 256 color image that has multiple color table entries with the same RGB value. In these cases, the loading process causes each of the duplicated RGB values to be remapped to the first occurrence in the color table of the same RGB value.

NOTE: This behavior only occurs under Windows NT. It does not occur under Windows 95 or Windows 98.


RESOLUTION

The simplest way to work around this problem is to avoid using the LoadImage() API, and use your own code to load the bitmaps.

Additional query words:

Keywords : kbAPI kbBitmap kbGDI kbWinOS2000
Version : WINDOWS:; winnt:4.0
Platform : WINDOWS winnt
Issue type : kbprb


Last Reviewed: December 20, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.