Jump to content
  • Advertisement

Archived

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

KuztomX

Loading windows bitmaps

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

I know this may sound like a basic question, but I havent been able to get it right. Anyone have the way to load an 8 bit windows bitmap? Im not interested in RLE bitmaps. I try to use the code in Tricks of the Window Programming Game Gurus but that doesnt seem to work with bitmaps of dimensions other than 320x240. They come out skewed slightly. Any help would be much appreciated. By the way, I need a way to manually load the bitmap instead of using LoadImage because I need the palette info and direct access to the bits. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Why not use GetDIBits() and GetPaletteEntries()? Both are GDI functions, and are used to retreive the acutal bits and the palette information. Use SetDIBits to set the bits in a bitmap. Use SetPaletteEntries to set the palette in a bitmap.

Share this post


Link to post
Share on other sites
Actually, I would rather to avoid those functions as they need a handle to a device context, and the game library I am writing is not going to be too platform specific, so I want to avoid using windows variables when possible.

Share this post


Link to post
Share on other sites
If i remember correctly, the bitmap size has to be a multiple of 8.. if you see the load bitmap code, you will see that assumption there, just remove it and it will work..

Share this post


Link to post
Share on other sites
It has to have a DWORD aligned width, I believe. Meaning it has to have a multiple of 4 as it''s width.

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!