ImageEn, unit iexBitmaps

TIOParams.TIFF_ImageCount

TIOParams.TIFF_ImageCount


Declaration

property TIFF_ImageCount: Integer; (Read-only)


Description

Returns the number of images/pages contained in the current TIFF. 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 EnumTiffIm.


See Also

ImageCount
IEGetFileFramesCount
TIFF_ImageIndex
Seek
EnumTiffIm
EnumTIFFStream


Examples

// Show number of pages in a TIFF
ImageEnView1.IO.LoadFromFile('C:\input.tif');
iPages := ImageEnView1.IO.Params.ImageCount;
ShowMessage('Page Count: ' + IntToStr(iPages));

// Print all pages of a TIFF
Printer.Title := 'TIFF Pages';
Printer.BeginDoc();
for I := 0 to ImageEnView1.IO.Params.ImageCount - 1 do
begin
  ImageEnView1.IO.Params.ImageIndex := I;
  ImageEnView1.IO.LoadFromFile('C:\input.tif');
  ImageEnView1.IO.PrintImage();
end;
Printer.EndDoc();

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