ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to Filter/Unfilter a TImageEnMView?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

skippix

USA
68 Posts

Posted - Jul 01 2019 :  18:07:34  Show Profile  Reply
I am working on an image rating module that mimics the functionality in the LightRoom Develop module.

Basically, the user loads a TImageEnMView and scrolls through the images with the ability to assign a keep/kill flag or a rating of 0-5. The user could be working with anywhere from 15 to 1000 images at a time (usually about 300).

I'm looking for the best way to allow the user to filter the image grid. Is there a way to do this without having to reload the grid every time the user toggles on/off the filter?

Thanks!

xequte

38189 Posts

Posted - Jul 02 2019 :  22:45:56  Show Profile  Reply
Hi

At this time, TImageEnMView shows all content, so filtering would require removing items from the list.

I'll look at adding filtering and a hidden state in a coming update.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

skippix

USA
68 Posts

Posted - Jul 03 2019 :  03:37:01  Show Profile  Reply
Awesome!
I'll see what I can do in the meantime.
Go to Top of Page

xequte

38189 Posts

Posted - Mar 28 2020 :  01:00:00  Show Profile  Reply
FYI, Filtering is available in the upcoming 9.0.0 release.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

skippix

USA
68 Posts

Posted - Nov 01 2020 :  12:40:39  Show Profile  Reply
I see that there is filtering functionality, but I'm not sure how to access it. Looking through the documentation, it appears that you can filter on the image filenames.

Is there any way to filter on other properties, like Checked?

Is there a demo for filtering, especially showing how to do a custom filter using OnFilter?

Thanks!
Go to Top of Page

xequte

38189 Posts

Posted - Nov 01 2020 :  17:52:13  Show Profile  Reply
Hi

Yes, the FilenameFilter only works on the filename:

https://www.imageen.com/help/TImageEnMView.FilenameFilter.html

Use OnFilter to apply filtering using other properties

https://www.imageen.com/help/TImageEnMView.OnFilter.html


Here is a demo:
attach/xequte/202011117511_FilteringDemo.zip
14.05 KB


Note: There are some optimizations that improve TImageEnMView performance (particularly when filtering is being used) that will be included in v9.2.6. Or you can email me for the source.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

skippix

USA
68 Posts

Posted - Nov 02 2020 :  11:53:47  Show Profile  Reply
Thanks, Nigel!

I made it work using a TStringList of filenames and a checkbox to toggle filtering.

procedure TfrmAssetCurator.ckbFilterGridClick(Sender: TObject);
var imgGrid: TImageEnMView;
begin
  if (not Self.Active) then
    Exit;

  if (iNavGrid = 0) then
    imgGrid := imgMView
  else
    imgGrid := imgMViewTarget;

  if (ckbFilterGrid.Checked) then
    GetCheckedImages (imgGrid)
  else
    fExcludedFiles.Clear;

  UpdateFilter(imgGrid);
end;

function TfrmAssetCurator.GetCheckedImages (imgGrid: TImageEnMView): Integer;
var i: Integer;
begin
  fExcludedFiles.Clear;
  for i := 0 to imgGrid.ImageCount-1 do
    if (not imgGrid.Checked[i]) then
      fExcludedFiles.Add(imgGrid.ImageFileName[i]);

  Result := fExcludedFiles.Count;
end;

procedure TfrmAssetCurator.imgMViewFilter(Sender: TObject; Index: Integer;
  const Filename: string; var ShowFrame: Boolean);
begin
  if fExcludedFiles.IndexOf( Filename ) >= 0 then
    ShowFrame := False;
end;

It's working well enough at the moment. I may reach out to you for source later, as well as some tips for speeding up the reloading the grid when clearing the filter.

Thanks again,
Skip
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: