PRB: LoadImage Alters Color Table with 256 Color Bitmaps (195831)



The information in this article applies to:

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional
  • Microsoft Windows NT Server 4.0
  • Microsoft Windows NT Workstation 4.0
  • Microsoft Windows XP Home Edition
  • Microsoft Windows XP Professional

This article was previously published under Q195831

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, Windows 2000, and Windows XP. 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.

Modification Type:MinorLast Reviewed:3/21/2005
Keywords:kbAPI kbBitmap kbGDI kbprb KB195831