Archived

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

KuztomX

Loading windows bitmaps

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
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