ImageEn, unit iemview

TImageEnMView.OnFilter

TImageEnMView.OnFilter


Declaration

property OnFilter: TIEShowFrameEvent;


Description

Occurs whenever a frame needs to be displayed. It can be used to implement your own custom filter.

Note:
ShowFrame defaults to True, unless it has been filtered by Filter
OnFilter is called frequently. Ensure your filtering code is quick to avoid slowing user interaction
If you change your filter, you should call Update


Demo

Demo  Demos\Multi\Filtering\Filtering.dpr


Examples

procedure TMainForm.IEMViewFilter(Sender: TObject; Index: integer; const Filename: string; var ShowFrame: Boolean);
begin
  // check filename does not exist in our excluded files list list
  if fExcludedFiles.IndexOf( Filename ) >= 0 then
    ShowFrame := False;
end;

procedure TMainForm.ImageEnMView1Filter(Sender: TObject; Index: Integer; const
    Filename: string; var ShowFrame: Boolean);
begin
  // Hide Landscape images
  if ShowFrame and
     chkHideLandscape.checked and
     ( ImageEnMView1.ImageWidth[Index] > ImageEnMView1.ImageHeight[Index] ) then
    ShowFrame := False
  else
  // Hide JPEG images
  if ShowFrame and
     chkHideJPEG.checked and
     (( Lowercase( ExtractFileExt( ImageEnMView1.ImageFilename[Index] )) = '.jpg' ) or
      ( Lowercase( ExtractFileExt( ImageEnMView1.ImageFilename[Index] )) = '.jpeg' )) then
    ShowFrame := False;
end;


See Also

Filter
FilterField
ImageFiltered
FilteredCount