Knowledge Base

PRB: LoadImage Alters Color Table with 256 Color Bitmaps

Article ID: 195831

Article Last Modified on 2/22/2007


APPLIES TO


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.

Keywords: kbapi kbbitmap kbgdi kbprb KB195831