I work with DIB bitmaps to do numeric simulations. DIBs are 8 bit. I fill the bitmap with colors which represent different materials, then I need to be absolutely certain what color API calls use when drawing on DIBs.
I use the PALETTEINDEX macro to declare the color I want, but if the color table of the DIB contains two identical colors, API uses the first occurrence of the two, no the one i want. If I create a pen with PALETTEINDEX, I can verify with GetObject that the color index loaded is that I want. But after drawing on the DIB in a memory context, the color loaded may be different.
The obvious way to solve the problem is to be sure all colors are different in the color table. Is it true? How big the difference must be? Is it sufficient 1 bit on either R, G or B)?
------------------
I use the PALETTEINDEX macro to declare the color I want, but if the color table of the DIB contains two identical colors, API uses the first occurrence of the two, no the one i want. If I create a pen with PALETTEINDEX, I can verify with GetObject that the color index loaded is that I want. But after drawing on the DIB in a memory context, the color loaded may be different.
The obvious way to solve the problem is to be sure all colors are different in the color table. Is it true? How big the difference must be? Is it sufficient 1 bit on either R, G or B)?
------------------
Comment