ImageEn, unit imageenio

TImageEnIO.LoadFromStreamJpeg

TImageEnIO.LoadFromStreamJpeg


Declaration

function LoadFromStreamJpeg(Stream: TStream): Boolean;


Description

Loads an image from a stream containing a JPEG file. The result will be false if an error is encountered, e.g. the file in the stream is not JPEG format (Aborting will be true).

Notes:
- If StreamHeaders property is True, the stream must have a special header (saved with SaveToStreamJPEG)
- LoadFromStreamJpeg does not reset the position of the stream, so you may need to first call Stream.Position := 0;


Example

// loads a JPEG file with LoadfFromStreamJPEG
var
  fs: TFileStream;
Begin
  fs := TFileStream.Create('C:\myfile.jpg', fmOpenRead);
  ImageEnView1.IO.LoadFromStreamJPG(fs);
  fs.free;
End;