Microsoft KB Archive/195831

{|
 * width="100%"|

PRB: LoadImage Alters Color Table with 256 Color Bitmaps

 * }

Q195831

-

The information in this article applies to:


 * Microsoft Windows NT Server version 4.0
 * Microsoft Windows NT Workstation version 4.0
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Professional

-

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 kbOSWin2000

Issue type : kbprb

Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT400xsearch kbwin2000AdvServ kbwin2000AdvServSearch kbwin2000Serv kbWinNTSsearch kbWinNTS400xsearch kbWinNTS400 kbwin2000ServSearch kbwin2000Search kbwin2000ProSearch kbwin2000Pro kbWinAdvServSearch