TImageEnIO.LoadFromFileGIF
Declaration
function LoadFromFileGIF(const FileName: WideString): integer;
Description
Loads an image from a GIF file (87a, 89a or animated GIF).
FileName is the file name including extension.
Returns the number of images contained in GIF file (if this is an animated GIF) or -1 if an error was encountered while loading, such as the file not being GIF format (
Aborting will be true). Loading errors due to a file not being available will raise an exception.
Note:
◼ You can abort loading by setting
Aborting to true
◼ If
AsyncMode=True the result will always be -1
◼ If you are loading from a multi-frame GIF, enable
GIFFrameCaching to speed up loading
◼ 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 the third frame of an animated gif
ImageEnView1.IO.Params.GIF_ImageIndex := 2;
ImageEnView1.IO.LoadFromFileGIF('D:\anim.gif');
See Also
◼ LoadFromStreamGIF◼ SaveToFileGIF◼ InsertToFileGIF◼ ReplaceFileGIF◼ GIF_ImageIndex◼ GIF_ImageCount◼ EnumGifIm (Image Count)
◼ CheckAniGIF◼ Global Image Methods