Weird Bitmap Problem

Hey there,

I'm new so I'd like to say "Hello" :)

I have a strange problem with creating a bitmap file. I'm using the MSDN BITMAPINFOHEADER Structure for creating a Bitmap file. It's 8 Bit grayscale, no compression, topside-down. Data are coming over DMA from a camera and are unsigned 8 bit grayscale values.

If I open the picture, it has color and contrast seems to be 250% too high?!

I checked the header information but couldn't find any reason for this behavior.

Thats the way it should look like:
http://www.freeimagehosting.net/qd1ku

And that's, what it looks like:
http://www.freeimagehosting.net/83r1s

Do you have any Ideas?

Thank you very much,

AllDayPiano
Last edited on
The Header of the bitmap is:

42 4D 36 00 04 00 00 00 00 00 36 00 00 00 28 00
00 00 00 02 00 00 00 02 00 00 01 00 08 00 00 00
00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00

Info-Header:
42 4D Its a Bitmap
36 00 04 00 Size of Bitmap = 0x04 00 36 - Header-Size = 512x512
00 00 00 00 Reserved
36 00 00 00 Offset = Sizeof(Bitmapinfoheader);

28 00 00 00 Sizeof(Bitmapinfoheader);
00 02 00 00 =0x200 = 512 px.
00 02 00 00 same
01 00 = 1 - Standard. Not used anymore.
08 00 Color dept = 8 bit.
00 00 00 00 Compression: 0 = none.
00 00 00 00 Filesize or zero
00 00 00 00 X-Dot-Per-Meter, may be left 0
00 00 00 00 y-Dot-Per-Meter, may be left 0
00 00 00 00 If zero, all 255 colors are used
00 00 00 00 If zero, no color table values are used

So far, everything seems to be fine...?!
Topic archived. No new replies allowed.