ImageEn, unit iexDBBitmaps

TIEDBMultiBitmap.Write

TIEDBMultiBitmap.Write


Declaration

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


Description

Writes image to a blob field, file or stream (including all its frames). This method supports all formats supported by TImageEnIO class.
The Write(); overload sets the image at the current database position using the properties of DataSource, ImageBlobField and/or FilenameField..
If saving to a blob or stream you must specify the FileType
You can optionally specify an TIOMultiParams object containing the I/O parameters of the file.
Returns true on success.

Note: Do NOT use this method when Mode = dmAllRecords


Examples

// Rotate the current image in the database (assumes you have set DataSource and ImageBlobField)
fDBMBitmap.Rotate( -90 );
MyTable.Edit;
MyTableName.AsString := 'Rotated 90';
fDBMBitmap.Write( MyTableImageBlob, ioJPEG );
MyTable.Post;


// Append an image to the database (maintaining its meta-data)
MBMP := TIEDBMultiBitmap.Create();
MBMP.ParamsEnabled := True; // So bitmap stores the params/meta-data
MBMP.Read( 'D:\MyBlobImage.jpeg' );
MyTable.Append;
MyTableName.AsString := 'My Cool Image';
MBMP.Write( MyTableImageBlob, ioTIFF );
MyTable.Post;
MBMP.Free;


See Also

 UpdateDatabaseImage
 Read