Archived

This topic is now archived and is closed to further replies.

Bitmap typedef stuff

This topic is 5678 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


typedef struct BMP_h_s {
u16 type;
u32 size, reserved, offset, headersize;
u32 width, height;
u16 planes, bitsperpixel;
u32 compression, sizeimage;
u32 xpixelspermeter, ypixelspermeter;
u32 colorsused, colorsimportant;
} BMP_h;

Share this post


Link to post
Share on other sites
I''m not sure but I think the above struct should be placed between #pragma pack(1) and #pragma pack().
I know it has something to do with the byte order, but I''m not sure how it works correctly.
Does anyone have a good explanation if that?

===========================
UNKNOWN caused an invalid page fault in module unknown at 0000:bff80eb6
: win98 with multiple sclerose

Share this post


Link to post
Share on other sites
What I''m actully asking for is if there is a header file (like windows.h) that allready contains these structs for BMPs, or do I have to define them my self (by getting them off a document about BMPs)

thx,

-J

Share this post


Link to post
Share on other sites
The BITMAPFILEHEADER and the BITMAPINFOHEADER structures (sorry for shouting ) are defined in "Wingdi.h" as follows:


  
typedef struct tagBITMAPFILEHEADER {
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BITMAPFILEHEADER, FAR *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER;

(...)

typedef struct tagBITMAPINFOHEADER{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER, FAR *LPBITMAPINFOHEADER, *PBITMAPINFOHEADER;


===========================
UNKNOWN caused an invalid page fault in module unknown at 0000:bff80eb6
: win98 with multiple sclerose

Share this post


Link to post
Share on other sites
btw, forgot to say: Wingdi.h is included by windows.h so you only have to include the last one.

===========================
UNKNOWN caused an invalid page fault in module unknown at 0000:bff80eb6
: win98 with multiple sclerose

Share this post


Link to post
Share on other sites