ImageEn, unit imageenio

TImageEnIO.LoadFromStreamGIF

TImageEnIO.LoadFromStreamGIF


Declaration

function LoadFromStreamGIF(Stream: TStream): integer;


Description

Loads an image from a stream containing a GIF file.

Returns the number of images contained in the stream (if this is an animated stream) or -1 if an error was encountered while loading, such as the file not being GIF format (Aborting will be true). File access errors will raise an exception. If AsyncMode=True the result will always be -1.

Notes:
- You can abort loading by setting Aborting to true
- If StreamHeaders property is True, the stream must have a special header (saved using SaveToStreamGIF).
- LoadFromStreamGIF does not reset the position of the stream, so you may need to first call Stream.Position := 0;


Example

// loads a GIF file with LoadfFromStreamGIF
var
  fs: TFileStream;
Begin
  fs := TFileStream.Create('C:\myfile.gif', fmOpenRead);
  ImageEnView1.IO.LoadFromStreamGIF(fs);
  fs.free;
End;


See Also

- LoadFromFileGIF
- SaveToStreamGIF
- GIF_ImageIndex
- GIF_ImageCount
- Global Image Methods