ImageEn, unit iexDBBitmaps |
|
TIEDBBitmap.ImagePath
Declaration
property ImagePath: string;
Description
If your database table references images that are stored locally as files (i.e.
ImageStorageMode =
isLinkedFile) then you can use
ImagePath to specify the folder where the files are located, i.e. the load path is specified by
ImagePath + "Filename Field content".
Example usage:
◼If
FilenameField is the full path to a local file then set
ImagePath to ''
◼If
FilenameField is only a name or has an invalid path then set
ImagePath to the image folder
ImagePath Property Value | Content of Filename Field | Loads Image From... |
| C:\Some Folder\MyImage.jpg | C:\Some Folder\MyImage.jpg |
C:\Some Folder\ | MyImage.jpg | C:\Some Folder\MyImage.jpg |
C:\Some Folder\ | ..\MyImage.jpg | C:\Some Folder\..\MyImage.jpg |
C:\Some Folder\ | D:\FolderX\MyImage.jpg | C:\Some Folder\MyImage.jpg |
http://www.imageen.com/images/ | MyImage.jpg | http://www.imageen.com/images/MyImage.jpg |
| http://www.imageen.com/images/MyImage.jpg | http://www.imageen.com/images/MyImage.jpg |
// Display content of a table where images are stored in a folder and their path and filename is referenced by the "ImageFilename" field
fDBBitmap := TIEDBBitmap.create();
fDBBitmap.DataSource := DataSource1;
fDBBitmap.FilenameField := 'ImageFilename';
ImageEnView1.SetExternalBitmap( fDBBitmap );
// Display content of a table where images are stored in a folder named "My Folder" and their filename is referenced by the "ImageName" field
fDBBitmap := TIEDBBitmap.create();
fDBBitmap.DataSource := DataSource1;
fDBBitmap.ImagePath := 'C:\My Folder\';
fDBBitmap.FilenameField := 'ImageName';
ImageEnView1.SetExternalBitmap( fDBBitmap );
Note: Don't forget to free the object...
procedure TMainForm.FormDestroy(Sender: TObject);
begin
FreeAndNil( fDBBitmap );
end;