How do I unzip a file at runtime?

I'm making a game which has an animated 261 frame intro (entirely BMP images). I would like to be able to extract them from my project's resources at runtime and then import them into DirectDraw to draw them. The problem is, my computer simply doesn't have enough power to build a project with 261 800x600 bitmaps!

Instead I would like to extract them from a ZIP file contained as a resource in my app, at runtime. How would I do this




Answer this question

How do I unzip a file at runtime?

  • rodniko

    .NET doesnt provide Zip Functionality out of the box. You'll need to find a third party component to handle this.

    A simple web search will reveal many components. A common one used is

    http://www.sharpziplib.com/

    .NET does have some compression routines - but they are not winzip file compatible.


  • Zadoras

    hi SJWhiteley,

    Let me know where such project is, because I don't see it.



  • chris29

    Thanks for your help.

  • fiaolle

    Doh!



  • J. Clark

    Thanks for your help everyone, but I already gave up trying to use compression and just shoved all the files into a DLL!

  • Mike Hildner

    It doesn't What about the System.IO.Compression Namespace There's a sample in the 101Samples.



  • shoeffie

    I use 7-Zip from http://www.7-zip.org/ which has a command-line interface, using ProcessStart
  • sangminny

    System.IO.Compression is a new namespace in .NET 2.0 so if you're running v1.1 and can't find it don't think you're crazy :)

  • Peter Huber

    101Samples/Base Class Library/Compression

    Right there. Or just type System.IO.Compression into help and I'm sure it'll show you how to use the compression namespace.



  • How do I unzip a file at runtime?