ImageEn, unit imageenio

TImageEnIO.LoadFromStreamHeif

TImageEnIO.LoadFromStreamHeif

Declaration

function LoadFromStreamHeif(Stream: TStream): Boolean;

Description

Loads an image from a stream containing a Heif file.
The result will be false if an error is encountered, e.g. the file in the stream is not Heif format (Aborting will be true).
The method used to load Heif files is specified by ActiveHeifEngine.

Note:
Multiple frame Heif files are supported, specify the image to load using ImageIndex
Does not reset the position of the stream, so you may need to first call Stream.Position := 0;
If NativePixelFormat = True, the image will be returned in ie32RGB format with alpha in the A channel

Example

var
  fs: TFileStream;
Begin
  fs := TFileStream.Create('myfile.heif', fmOpenRead);
  if ImageEnView1.IO.LoadFromStreamHeif(fs) = False then
    ShowMessage('Not a Heif file!');
  fs.Free();
End;

See Also

LoadFromFileHeif
SaveToFileHeif