?
Ich denke das fread korrekt arbeitet, denn sonst wäre dein Bitmapheader ja auch
falsch. Soweit ich weis, werden BMP's von unten nach oben eingelesen.
Du must also die Datei von hinten nach vorne in den Speicher einlesen oder
mit einer Funktion die Scanlines tauschen. Eine Beschreibung dazu ist in der
MSDN:
The following illustration presents the developer's perspective of the bitmap found in the file Redbrick.bmp. It shows a palette array, a 32-by-32 pixel rectangle, and the index array that maps colors from the palette to pixels in the rectangle.
row 0, scanline 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
row 1, scanline 30 00 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00
row 2, scanline 29 11 11 01 19 11 01 10 10 09 09 01 09 11 11 01 09
.
.
.
row 31, scanline 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99
In the preceding example, the rectangle of pixels was created on a VGA display device using a palette of 16 colors. A 16-color palette requires 4-bit indexes; therefore, the array that maps palette colors to pixel colors is composed of 4-bit indexes as well. (For more information about logical color-palettes, see Colors.)
Note In the above bitmap, the system maps indexes to pixels beginning with the bottom scan line of the rectangular region and ending with the top scan line. A scan line is a single row of adjacent pixels on a video display. For example, the first row of the array (row 0) corresponds to the bottom row of pixels, scan line 31. This is because the above bitmap is a bottom-up device-independent bitmap (DIB), a common type of bitmap. In top-down DIBs and in device-dependent bitmaps (DDB), the system maps indexes to pixels beginning with the top scan line.
Eine detailierte Beschreibung ist in der MSDN unter: About Bitmaps zu finden
Gruss
EB