ImageEn, unit iexBitmaps

TIOMultiParams.Read

TIOMultiParams.Read

Declaration

function Read(const FileName: WideString; FileType: TIOFileType = ioUnknown): Boolean; overload;
function Read(const FileName: WideString; UseExtension: Boolean): Boolean; overload;
function Read(Stream: TStream; FileType: TIOFileType = ioUnknown): Boolean; overload;
function Read(Buffer: Pointer; BufferSize: Integer; FileType: TIOFileType = ioUnknown): Boolean; overload;

Description

Reads the properties from an image file. Result is False if a loading error is encountered due to a corrupt or unknown image FileType.

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

Examples

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

// Load the parameters of a TIFF
IOParams.Read( 'C:\alfa.tiff', ioTIFF  );
Label1.Caption := 'alfa.tiff contains ' + IntToStr(IOParams[0].ImageCount) + ' images';

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