Using Compressed Bitmaps

Started by
3 comments, last by insomniac2846 20 years ago
I found a bitmap loader that I''m trying to use for a 2D project/ However, it seems that it only works for uncompressed bitmaps. are there any programs for decompressing bitmaps or do I need to get down and dirty and mess with RLE compression. Thanx for any answers. With great power comes great reponsibility.
With great power comes great reponsibility.
Advertisement
If this game is only targetting windows, it would probably be easiest to use the windows LoadImage function with the LR_LOADFROMFILE flag.

If you need crossplatform compatibility, you'll have to write your own. This article at codeproject has an implementation that you can base yours on. Download the code and check out ximabmp.cpp. You can't stick it straight in though, it uses some custom classes that you'll have to remove first.

EDIT: ximabmp.cpp, not xwimabmp.cpp

[edited by - Melekor on March 22, 2004 9:52:26 PM]
THanx for the resonse. I was just wonderin. The code I found for the bitmap loader was basically the code in NeHe Opengl tutorial encapsulated into a class. Even though his example works with the bmp he gives, does it work with compressed pics? If so, how does it do it? or do you have to add that funtionality your self? Thanx again.
With great power comes great reponsibility.
Just use a pre-made image loader like DevIL (OpenIL) or something similar. Link it in, point it at your image files (whatever the format) and go. Nothing could be easier.
enum Bool { True, False, FileNotFound };
THANX A LOT!!!
With great power comes great reponsibility.

This topic is closed to new replies.

Advertisement