ImageEn, unit iemview

TImageEnMView.OnGetLoadFilename

TImageEnMView.OnGetLoadFilename


Declaration


property OnGetLoadFilename: TIEGetLoadFilenameEvent;


Description


Occurs whenever an image is loaded from file, allowing an alternative filename to be specified.

Index is the index of the image being displayed (i.e. 0 for first image in the grid, 1 for second, etc.)
Filename is the image to load to fill the displayed thumbnail.


Example


procedure TMyForm.ImageEnMViewOnGetLoadFilename(Sender: TObject; Index: integer; var Filename: string);
var
  cacheFilename: string;
begin
  // Use our own cache as a source for thumbnails
  cacheFilename := LookupCacheTable( Filename );
  if cacheFilename = '' then
  begin
    cacheFilename := GenerateCacheFile( Filename );
    AddToCacheTable( Filename, cacheFilename );
  end;

  Filename := cacheFilename;
end;


See Also


- OnImageIDRequest
- OnImageIDRequestEx