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 | Demos\InputOutput\IEViewMulti\IEViewMulti.dpr |
// 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
aBmp := TIEBitmap.Create();
aBmp.ParamsEnabled := True; // Load params with the image
aBmp.Params.ImageIndex := 2;
aBmp.LoadFromFile( 'C:\MyTiffDoc.TIFF' );
aBmp.Params.JPEG_Quality := 70;
aBmp.SaveToFile( 'D:\Page3.jpeg' );
aBmp.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