Jump to content
  • Advertisement

Archived

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

Jason2Jason

Bitmap typedef stuff

This topic is 5892 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

Does windows (or any other header file) define the structs needed to load in a bitmap file (like BMPINFOHEADER ), or do I have to define them myself? thx, J

Share this post


Link to post
Share on other sites
Advertisement
I did, thats why I'm asking if theres the structs pre defined so I don't have to type them out

-J

[edited by - jason2jason on June 2, 2002 12:15:29 PM]

Share this post


Link to post
Share on other sites

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!