ImageEn, unit iexDBBitmaps |
|
TIEDBMultiBitmap.DataSource
Declaration
property DataSource: TDataSource;
Description
Link the multi-bitmap with a dataset. The content will automatically update as the attached table changes. You will also need to set
FilenameField or
ImageBlobField.
Note: The maximum images that will be loaded is specified by
MaxDisplayRecords
// Display content of a table where images are stored in a blob field
fDBMBitmap := TIEDBMultiBitmap.create();
fDBMBitmap.DataSource := DataSource1;
fDBMBitmap.ImageBlobField := 'ImageBlob';
ImageEnMView1.SetExternalMBitmap( fDBMBitmap );
// Display content of a table where images are stored in a blob field and name of image is stored in "ImageName" field
fDBMBitmap := TIEDBMultiBitmap.create();
fDBMBitmap.DataSource := DataSource1;
fDBMBitmap.FilenameField := 'ImageName';
fDBMBitmap.ImageBlobField := 'ImageBlob';
ImageEnMView1.SetExternalMBitmap( fDBMBitmap );
// Display content of a table where images are stored in a folder and their path and filename is referenced by the "ImageFilename" field
fDBMBitmap := TIEDBMultiBitmap.create();
fDBMBitmap.DataSource := DataSource1;
fDBMBitmap.FilenameField := 'ImageFilename';
ImageEnMView1.SetExternalMBitmap( fDBMBitmap );
// Display content of a table where images are stored in a folder named "My Folder" and their filename is referenced by the "ImageName" field
fDBMBitmap := TIEDBMultiBitmap.create();
fDBMBitmap.DataSource := DataSource1;
fDBMBitmap.ImagePath := 'C:\My Folder\';
fDBMBitmap.FilenameField := 'ImageName';
ImageEnMView1.SetExternalMBitmap( fDBMBitmap );
Note: Don't forget to free the object...
procedure TMainForm.FormDestroy(Sender: TObject);
begin
FreeAndNil( fDBMBitmap );
end;