• Advertisement

Archived

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

Loading a zipped bitmap to Direct Draw surface

This topic is 5502 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''m making a 2d game and wan''t the bitmaps to be in .zip files but don''t know how to load them to surfaces. Can someone help..

Share this post


Link to post
Share on other sites
Advertisement
I don''t see how you could load a .zip file as an image. Why don''t you just keep them as bitmaps?

Share this post


Link to post
Share on other sites
computer_guy:

It''s two different things you want to do, one: read a file from inside a .zip, and two: load a bitmap onto a surface. So you should tackle the two parts separately:

1) To read from the .ZIP file (or similar), start with ZLIB (www.zlib.org, you should find all the relevent libs and code on there.)

2) To read a bitmap file from memory, you should be able to find quite a bit of sample source code very quickly with a Google for something like DirectDraw+BMP+loading.



Or you could just use PNG files which are compressed with ZLIB anyway (depends what the purpose of reading from the zip is - the compression or the monolithic archive [keep the file open all the time if its the latter or you won''t get the benefits])...

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites

  • Advertisement