title: JPEG data-stream to TImage
body: <p>I have some image-files stored into one file (some kind of archive). That file looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/LUFhe.jpg" alt="enter image description here"></p>
  
  <p>Well, it's separated into two segments - header and data-segment. Header (green) contains various info, such as album name, location, date/time, description, number of photos in the album, etc. Data segment (blue &amp; orange) has simple structure and it contains <strong>N</strong> x JPEG photo. I can extract that "imagedata" segment into new TMemoryStream object and now I want to show it using TImage.</p>
  
  <p>I can use <strong>SaveAsFile</strong> method of TMemoryStream, set some temporary file-name, load that file from TImage, and later, remove temporary file. That works, but I'm wondering is there any way to send that stream into TImage w/out using temp. files.</p>
  
  <p>Of course, I can write code to extract all those files on hard disk but problem is that I have a lot of archives like this one and just want to write application to read those "albums" instead of having 20,000+ photos on my hard drive.</p>
  
  <p>In short, all I want is to make following procedure works (w/out using temp. files)</p>
  
  <pre><code>procedure ShowImageFromStream(data: TStream; img: TImage);
  begin
  ...
  end;
  </code></pre>
  
  <p>Thanks in advance.</p>