If you use an RGB for drawing, the DIB driver will use the closest match found in the color table of the DIB. If you want to draw with a direct color table index, use the DIBINDEX macro in the MMSYSTEM.H file to obtain the index.