Hi,
I am having some trouble generating the header for a BMP file by using the structures below. I set byte to 0x42,0x4D but what I write to filesz gets split between the magic bytes and the upper two bytes of filesz. I am assuming this is an alignment issue with the processor at run time.
What's the best way to deal with this?
Thanks,
Ian
struct bmpfile_magic {
UINT8 byte[2];
};
struct bmpfile_header {
UINT32 filesz;
UINT16 creator1;
UINT16 creator2;
UINT32 bmp_offset;
};
struct bmpfile_info
{
UINT32 sz;
UINT32 wid;
UINT32 hei;
UINT16 planes;
UINT16 bpp;
UINT32 compression;
UINT32 sz_bmp;
UINT32 hor_rez;
UINT32 vert_rez;
UINT32 colors_used;
UINT32 colors_important;
};