Advertisement

hi, plz explain Device Depended bitmaps and Device Indepedent bitmap....

Started by May 08, 2002 09:56 AM
10 comments, last by mickey 22 years, 9 months ago
Um.. I can''t really tell you what happens under the hood of SelectObject since that''s too deep down Win32. From what I understand, if you''re trying to select a compatible bitmap then a) if it''s of the same format as the device, no color conversion is performed and the picture looks as intended; or b) if it''s not of the same format as the device, or if it has a different palette, still no color conversion will be performed but the colors may be different/distorted. If you''re trying to select a DIB into a DC, then Windows will try to match the colors present in the DIB to the colors available on the device (DC), using the color palette in the DIB, which should result in better picture in case conversion is needed.

In other words: DDBs are used "as-is". If you create a DDB with one palette and use it in a DC with another palette, you''ll get improper colors. DIBs contain palette information and thus Windows can perform color conversion so that your picture is (approximately) of the same color even though it will use another palette.

As I already said, today palettes are pretty much obsolete.

I have to correct myself: DIBs CAN be selected into a DC. I didn''t realize that I was doing exactly this in my font engine.
---visit #directxdev on afternet <- not just for directx, despite the name
alright, thanks indirectx,
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,

This topic is closed to new replies.

Advertisement