Declarationfunction LoadFromStreamGIF(Stream: TStream): integer;
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.
- You can abort loading by setting Aborting
- 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;
- By default, GIF_RawLoad
is enabled, so the frame returned will be merged to ensure it is a valid image (contains needed content from prior frames)
Example// loads a GIF file with LoadFromStreamGIF
fs := TFileStream.Create('C:\myfile.gif', fmOpenRead);
- Global Image Methods