ImageEn, unit iexDBBitmaps

TIEDBMultiBitmap.ImagePath

TIEDBMultiBitmap.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 erroneous 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


Examples

// 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;