ImageEn, unit iexBitmaps

TIOParams.GIF_ImageCount

TIOParams.GIF_ImageCount


Declaration

property GIF_ImageCount: Integer; (Read-only)


Description

Returns the number of images contained in the currently loaded GIF. You can use Seek to load/navigate images within the loaded file.

Note: You can use ImageCount for generic access to the image count (not specific to an image format). For non-component access, see EnumGifIm.


See Also

 ImageCount
 IEGetFileFramesCount
 GIF_ImageIndex
 Seek
 EnumGifIm


Examples

// Return the frame count of 'animated.gif' without load the GIF
ImageEnView1.IO.ParamsFromFile('C:\Animated.gif');
iImageCount := ImageEnView1.IO.Params.GIF_ImageCount;

// Print all images of a GIF
Printer.Title := 'GIF Frames';
Printer.BeginDoc();
for I := 0 to ImageEnView1.IO.Params.GIF_ImageCount - 1 do
begin
  ImageEnView1.IO.Params.GIF_ImageIndex := I;
  ImageEnView1.IO.LoadFromFile('C:\input.gif');
  ImageEnView1.IO.PrintImage();
end;
Printer.EndDoc();

// Load a GIF and save each of its pages as a BMP File
ImageEnView1.IO.LoadFromFile('C:\input.gif');  // Load first image to get value for Params.GIF_ImageCount
for I := 0 to ImageEnView1.IO.Params.GIF_ImageCount - 1 do
begin
  ImageEnView1.IO.Params.GIF_ImageIndex := I;
  ImageEnView1.IO.LoadFromFile('C:\input.gif');
  ImageEnView1.IO.SaveToFile( format( 'D:\image_%d.bmp', [ I + 1 ]);
end;