In Modes 3 and 5, I know that the color depth is 15-bit in BGR format. However, when my bitmap is being drawn, it''s as if it''s in RBG (i.e. RGB with the green and blue switched). It''s just a simple 24-bit bitmap. I wrote a program to convert .bmp''s into .h''s with hard-coded data, and for exmaple yellow (R=255, G=255, B=0) comes out as 0xE07F (Note that the bytes are swapped in lo-hi instead of hi-lo, which the normally are, so it comes out to 0111 1111 1110 0000 in binary) after it is ran through the program. When it is displayed, it comes out as magenta. Does anyone know why this would be happening?
2 replies to this topic
Members - Reputation: 372
Posted 19 January 2002 - 02:39 PM
Never mind, I figured it out. I did have to swap the bytes in each word (i.e. change 0xEO7F to 0x7FE0), and I also had to swap the red and blue values. It just kind of confuses me the way words and double-words are stored. For example, if I have a short that is 0xABCD (43,981) and I saved it to a file, the bytes would read CD AB, not AB CD. Anyways, forget I even posted this here.