| ImageEn, unit iexDBBitmaps |
|
TIEDBMultiBitmap.Read
Declaration
function Read(): Boolean; overload;
function Read(aBlobField: TBlobField; FileType: TIOFileType = ioUnknown; IOParams: TIOMultiParams = nil): Boolean; overload;
Description
Load an image from a blob field, file or stream (including all its frames) of any format supported by the
TImageEnMIO 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
ioUnknown is specified, the format is detected automatically by reading the image header.
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