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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to Filter/Unfilter a TImageEnMView?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
skippix Posted - Jul 01 2019 : 18:07:34
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!
6   L A T E S T    R E P L I E S    (Newest First)
skippix Posted - Nov 02 2020 : 11:53:47
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
xequte Posted - Nov 01 2020 : 17:52:13
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
skippix Posted - Nov 01 2020 : 12:40:39
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!
xequte Posted - Mar 28 2020 : 01:00:00
FYI, Filtering is available in the upcoming 9.0.0 release.

Nigel
Xequte Software
www.imageen.com
skippix Posted - Jul 03 2019 : 03:37:01
Awesome!
I'll see what I can do in the meantime.
xequte Posted - Jul 02 2019 : 22:45:56
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