bitmap color palette problems

I am working on a highly graphically intense program in Delphi 3.  The
program reads and writes binary files that have Bitmaps stored in
them.  My problem is that I get a different bitmap file format based
on the display mode I am using:

Using a 256 color video mode:
        Bitmap.SaveToStream( fileStream );

will result in a 256 color bitmap, no compression.

Using a 65K color video mode:
        Bitmap.SaveToStream( fileStream);

will result in a 16 bit  bitmap using type 3 ( bitfield encoding
compression ).

If I set Bitmap.pixelFormat := pf8bit and then Bitmap.SaveToStream, I
get different colors when I read the bitmap back from the file then
when it was orginally displayed ( before saving ).

What I am doing is reading several small bitmap files ( all the same
size, all the same 256 color palette ) and copying them to a larger
bitmap image.  I also take the palette of the first bitmap and assign
it to the palette of the larger bitmap.  I then save the larger image
to the file ( above ).

Any help would be appreciated.

todd
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

The more I learn, the less I know.
This could take forever.

Todd Palmer
Developer
t2pal...@avana.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-