I have some image files stored in one file (some kind of archive). This file is as follows:

Well, it is divided into two segments - the header and the data segment. The title (green) contains various information, such as album name, location, date / time, description, number of photos in the album, etc. The data segment (blue and orange) has a simple structure and contains N x JPEG photos. I can extract this "imagedata" segment into a new TMemoryStream object, and now I want to show it using TImage.
I can use the SaveAsFile TMemoryStream method, set a temporary file name, load this file from TImage, and then delete the temporary file. This works, but I am wondering if there is a way to send this stream to TImage using temp. files.
Of course, I can write code to extract all these files to the hard drive, but the problem is that I have a lot of archives like this, and I just want to write an application to read these βalbumsβ instead of 20,000 photos on my hard disk.
In short, all I want is to do the following procedures (without using temporary files)
procedure ShowImageFromStream(data: TStream; img: TImage); begin ... end;
Thanks in advance.
delphi filestream delphi-7 timage
Wh1t3h4ck5
source share