Bitmap File Format

Search this archive.

From: Patrick Mochel (mochelp@ironarm.com)
Date: Sun 09 Jul 2000 - 12:33:24 IDT


I'm writing a simple little program that displays a bitmap file using
svgalib.  For the sake of simplicity, I am using only non-compressed,
8-bit Windows bitmaps.
For some reason, I cannot get the color settings right when displaying the
image.  I was hoping someone might be familiar with the bitmap file
format.

In the image, the color map starts at 0x36, and contains 1024 bytes: 256
blue-green-red settings with a dummy byte at the end of each. e.g.
byte b;
byte g;
byte r;
byte dummy;

So, I read all of those into this arrayn, then iterate through each,
calling vga_setpalette for each bgr triplet (and I am remembering to
reverse the b and r when I call it).  

It seems as though it should be as simple as that, but the colors are
always off.  Does anyone have any ideas why this is?

thanks,

-pat


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST