The header of a bmp file is supposed to be:
typedef struct
{
unsigned short bfType;
unsigned int bfSize;
unsigned short bfReserved1;
unsigned short bfReserved2;
unsigned int bfOffBits;
} BITMAPFILEHEADER;
I'm reading this header like this:
fread(&header, sizeof(BITMAPFILEHEADER), 1, fp)
and it seems to be working fine. The bfType is correct, but everything else is... not right. bfSize = 0 or 3 or something like that, bfOffBits is 7 digits long etc.. Is this maybe a problem with structure aligment, or something else?
Please help!
typedef struct
{
unsigned short bfType;
unsigned int bfSize;
unsigned short bfReserved1;
unsigned short bfReserved2;
unsigned int bfOffBits;
} BITMAPFILEHEADER;
I'm reading this header like this:
fread(&header, sizeof(BITMAPFILEHEADER), 1, fp)
and it seems to be working fine. The bfType is correct, but everything else is... not right. bfSize = 0 or 3 or something like that, bfOffBits is 7 digits long etc.. Is this maybe a problem with structure aligment, or something else?
Please help!