ImageEn, unit imageenio

TImageEnIO.GIFFrameCaching

TImageEnIO.GIFFrameCaching


Declaration

property GIFFrameCaching: TIEGIFFrameCaching;


Description

Whether frames of animated/multi-frame GIF should be cached to speed up subsequent loading.
Animated GIF files are usually optimized which requires the loading of all previous frames to access the content of a desired frame (because frames are merged together).
This can be slow with large GIF files so GIFFrameCaching enables caching of the previously loaded frame.

Value Description
iefcNever GIF frames are not cached
iefcAuto The previous GIF frame is cached when playing or seeking a multi-frame GIF
iefcAlways The previous GIF frame is always cached (so subsequent loads of the current or next frame are much faster)
iefcAllFrames All frames of the GIF are cached on first load. This will make the initial load much slower, but adhoc access to any frame will be instaneous

Default: iefcAuto (cached only when playing or seeking)


Example

// General usage to speed up loading of GIF frames
ImageEnView1.IO.GIFFrameCaching := iefcAlways;
cnt := IEGetFileFramesCount( GetGifFilename() );
for i := 0 to cnt - 1 do
begin
  ImageEnView1.IO.GIF_ImageIndex := i;
  ImageEnView1.IO.LoadFromFileGIF( GetGifFilename() );
  ImageEnView1.IO.PrintImage();
end;

// Caching of all frames so that we can access random frames very quickly (initial load is slower, and uses more memory)
ImageEnView1.IO.GIFFrameCaching := iefcAllFrames;
ImageEnView1.IO.GIF_ImageIndex := idx;
ImageEnView1.IO.LoadFromFileGIF( GetGifFilename() );


See Also

- GIF_RAWLoad
- GIF_Action
- GIF_XPos
- GIF_YPos