Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8085369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:05:37+00:00 2026-06-05T18:05:37+00:00

I’m wanting to extract a zip file loaded with images into memory in some

  • 0

I’m wanting to extract a zip file loaded with images into memory in some way. I don’t really care what type of stream they go into, as long as I can load them afterwards. I do not have that great of an understanding with streams, and explanations on the subject don’t seem to go into much detail.

Essentially, what I am doing now is extracting the files to (getcurrentdir + ‘\temp\’). This works, but isn’t quite what I am wanting to do. I would be more happy to have the jpg’s end up in memory and then be able to read from memory into a TImage.bitmap.

I am currently using jclcompresion to handle zips and rars, but was considering moving back to system.zip because I really only need to be able to handle zip files. If it would be easier to stay with jclcompression though that would work for me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:05:39+00:00Added an answer on June 5, 2026 at 6:05 pm

    The read method of the TZipFile class can be used with a stream

    procedure Read(FileName: string; out Stream: TStream; out LocalHeader: TZipHeader); overload;
    procedure Read(Index: Integer; out Stream: TStream; out LocalHeader: TZipHeader); overload;
    

    from here you can access the compressed file using the index or the filename.

    Check this sample which uses a TMemoryStream to hold the uncompressed data.

    uses
      Vcl.AxCtrls,
      System.Zip;
    
    procedure TForm41.Button1Click(Sender: TObject);
    var
      LStream    : TStream;
      LZipFile   : TZipFile;
      LOleGraphic: TOleGraphic;
      LocalHeader: TZipHeader;
    begin
      LZipFile := TZipFile.Create;
      try
        //open the compressed file
        LZipFile.Open('C:\Users\Dexter\Desktop\registry.zip', zmRead);
        //create the memory stream
        LStream := TMemoryStream.Create;
        try
          //LZipFile.Read(0, LStream, LocalHeader); you can  use the index of the file
          LZipFile.Read('SAM_0408.JPG', LStream, LocalHeader); //or use the filename 
          //do something with the memory stream
          //now using the TOleGraphic to detect the image type from the stream
          LOleGraphic := TOleGraphic.Create;
          try
             LStream.Position:=0;
             //load the image from the memory stream
             LOleGraphic.LoadFromStream(LStream);
             //load the image into the TImage component
             Image1.Picture.Assign(LOleGraphic);
          finally
            LOleGraphic.Free;
          end;
        finally
          LStream.Free;
        end;
      finally
       LZipFile.Free;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.