Advertisement

Other file formats under Windows

Started by May 20, 2001 08:58 PM
2 comments, last by Absolution 23 years, 8 months ago
I have wrote a game which uses the .PCX format to load it''s images. I wrote my own decoder and such. I have no problem with directx. However, I am making an editor and I would like to load these pcx pictures and display them using the Device Context/Windows API. The problem is, all windows calls are built around the BMP format. So, I guess I need to load my pcx files in and convert them to a bitmap format before I can display them. I have no idea how to do this. I have tried using the CBitmap class and its SetBits/CreateBitmap calls, but this is not working. I don''t want to have to save my images in both formats since that would be a waste of space. I suppose I could have my game use bmp files, but it is already written around the pcx format. Any ideas? Abs
Easiest way would be to create a device context for the image and then load in the pcx to the HDC pixel by pixel.

Not necessarily efficient, but easy.

Resist Windows XP''s Invasive Production Activation Technology!
BetaShare - Run Your Beta Right!
Advertisement
Just create a BITMAP structure - it's format is quite simple, then use CreateBitmapIndirect() to create a HBITMAP from that, then it's simple to BitBlt to the DC you want.


War Worlds - A 3D Real-Time Strategy game in development.

Edited by - Dean Harding on May 21, 2001 1:29:18 AM
Hmm, I think the problem with that last idea is that I would first have to detect the Colour-depth/pixel-format of the system and then make my bitmap compatible. Seems like a lot of work. My pcx files are just 8-bit indexed colour too.

Abs

This topic is closed to new replies.

Advertisement