ImageEn, unit iexBitmaps

TIOParams.ImageIndex

TIOParams.ImageIndex

Declaration

property ImageIndex: Integer;

Description

Specifies the index of the next page/frame to load. You must set this property before calling read methods like LoadFromFile.
This property is valid for all multi-page file formats (TIFF, GIF, DCX, Dicom, etc..).

Note:
Setting ImageIndex is the same as setting the relevant format image index: TIFF_ImageIndex, GIF_ImageIndex, ICO_ImageIndex or CUR_ImageIndex.
If attached to a TImageEnView with the PDFViewer enabled, setting ImageIndex will set the PageIndex

Default: 0

Demo

Demo  Demos\InputOutput\IEViewMulti\IEViewMulti.dpr

Examples

// Load the second page of the TIFF
ImageEnView1.IO.Params.ImageIndex := 1;
ImageEnView1.IO.LoadFromFile('C:\input.tif');

// 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 the third image in a TIFF and save it to JPEG
bmp := TIEBitmap.Create();
bmp.ParamsEnabled := True; // Load params with the image
bmp.Params.ImageIndex := 2;
bmp.LoadFromFile( 'C:\MyTiffDoc.TIFF' );
bmp.Params.JPEG_Quality := 70;
bmp.SaveToFile( 'D:\Page3.jpeg' );
bmp.Free();

// 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.ImageCount
for i := 0 to ImageEnView1.IO.Params.ImageCount - 1 do
begin
  ImageEnView1.IO.Params.ImageIndex := i;
  ImageEnView1.IO.LoadFromFile('C:\input.gif');
  ImageEnView1.IO.SaveToFile( Format( 'D:\Image_%d.bmp', [ i + 1 ]);
end;

See Also

ImageCount
Seek