ImageEn, unit iexDBBitmaps |
|
TIEDBMultiBitmap
Properties · Methods · Events · Demos
Declaration
TIEDBMultiBitmap = class(TIECustomMultiBitmap);
Description
TIEDBMultiBitmap is a descendant of
TIECustomMultiBitmap, but unlike
TIEMultiBitmap it links to a datasource to provide access to images stored in a database table.
Generally a TIEDBMultiBitmap is
attached to a
TImageEnMView to make it DB aware.
TIEDBMultiBitmap supports both images stored within the database as a blob (by setting
ImageBlobField) or images stored locally and referenced by a filename field (by setting only
FilenameField). You will also need to set
DataSource.
TIEDBMultiBitmap can operate in two
modes:
◼Showing all images in a table (the multi-bitmap will contain one image per table record)
◼Showing an image with one or more frames at the current database position (the multi-bitmap will show the image for one database record, which may have multiple frames, e.g. a TIFF)
You can also use TIEDBMultiBitmap to retrieve an image (optionally with multiple frames, like a TIFF) embedded in a database blob field using the data-aware overload of
Read.
// Extract an image from a database and save it
MyMBMP := TIEDBMultiBitmap.Create();
MyMBMP.Read( MyTableImageBlob );
MyMBmp.Write( 'D:\MyBlobImage.TIFF' );
MyMBmp.Free;
Demo | Description | Demo Project Folder | Compiled Demo |
Database Thumbnail Viewer | Use of FireDAC and a TIEDBMultiBitmap to make a data-aware TImageEnMView that displays thumbnails of all images in a database table | Database\DBMultiBitmap_AllRecords\DBMultiBitmapFD.dpr | |
Database Multi-Frame Demo | Use of FireDAC and a TIEDBMultiBitmap to make a data-aware TImageEnMView that displays a multi-frame image at the current position of a database table | Database\DBMultiBitmap_MultiFrame\DBMultiBitmapFD2.dpr | |
// Create DB Aware TImageEnMView
procedure TMainForm.FormCreate(Sender: TObject);
begin
... Open a database table ...
fDBMBitmap := TIEDBMultiBitmap.create( DataSource1, 'Image', 'Name' );
ImageEnMView1.SetExternalMBitmap( fDBMBitmap );
end;
procedure TMainForm.FormDestroy(Sender: TObject);
begin
FreeAndNil( fDBMBitmap );
end;
GeneralDatabase - GeneralDatabase - All Records ModeDatabase - Single Record (Frames) ModeDatabase EditingImage AccessImage InformationInput/OutputInput/Output Parameters (Meta-Data)Image EditingEvents Unique functionality to TIEDBMultiBitmap