ImageEn, unit iexDBBitmaps

TIEDBMultiBitmap.Read

TIEDBMultiBitmap.Read


Declaration

function Read(): boolean; overload;
function Read(aBlobField: TBlobField; FileType: TIOFileType = 0; IOParams: TIOMultiParams = nil): boolean; overload;


Description

Load an image from a blob field, file or stream (including all its frames). This method supports all formats supported by TImageEnIO class.
The Read(); overload reads the image at the current database position using the properties of DataSource, ImageBlobField and/or FilenameField.
When reading from a blob or stream you can optionally specify the Format. If it is not specified ImageEn will determine the file type automatically.
You can optionally pass an TIOMultiParams object for the I/O parameters of the file.
Returns False on failure.

Note: Do NOT use this method when Mode = dmAllRecords


Examples

// Extract an image from a database and save it
MBMP := TIEDBMultiBitmap.Create();
MBMP.Read( MyTableImageBlob );
MBMP.Write( 'D:\MyBlobImage.jpeg' );
MBMP.Free;

// Reduce the size of an image in the database
MBMP := TIEDBMultiBitmap.Create();
MBMP.Read( MyTableImageBlobField );
MBMP.Resample( 800, 600, rfLanczos3, true);
MBMP.JpegQuality := 75;
MBMP.Write( MyTableImageBlobField, ioJPEG );
MBMP.Free;


See Also

 LoadImage
 Write
 WicFastLoading