ImageEn, unit iemio

TImageEnMIO.ParamsFromFile

TImageEnMIO.ParamsFromFile


Declaration

function ParamsFromFile(const FileName: WideString; Format: TIOFileType = ioUnknown): Boolean; overload;
function ParamsFromFile(const FileName: WideString; bUseExtension: Boolean): Boolean; overload;


Description

Reads the image properties without loading the image (and without changing the current image). Result is false if a loading error is encountered due to a corrupt or unknown image format.

FileName is the file name with full path.
Format is the file format that the stream or file contains. If ioUnknown is specified then the file content is analyzed to determine the format.
bUseExtension determines that the file format is based on the extension of the file, e.g. image.jpeg will be processed as ioJPEG format.


Examples

// Load the parameters of an image (which may be a TIFF file, but we will examine the content to be sure)
ImageEnView1.IO.ParamsFromFile( 'C:\alfa.tiff' );
Label1.Caption := 'alfa.tiff contains ' + inttostr(ImageEnView1.IO.Params[0].ImageCount) + ' images';

// Load the parameters of a TIFF
ImageEnView1.IO.ParamsFromFile( 'C:\alfa.tiff', ioTIFF  );
Label1.Caption := 'alfa.tiff contains ' + inttostr(ImageEnView1.IO.Params[0].ImageCount) + ' images';

// Load the parameters of a file. It will be assumed to a TIFF because of the file extension
ImageEnView1.IO.ParamsFromFile( 'C:\alfa.tiff', True );
Label1.Caption := 'alfa.tiff contains ' + inttostr(ImageEnView1.IO.Params[0].ImageCount) + ' images';