ImageEn, unit iemview

TImageEnMView.Filter

TImageEnMView.Filter


Declaration

property Filter: String;


Description

Limit display to files that match a specified filter.
By default, filteres are compared against the filename, but you can specify an alternative field using FilterField.
You can also filter by index by prefixing values with a # symbol.
If Filter is blank, all files are displayed.

Note:
When filtering is active the filtered frames are hidden from display but still available programmatically
For more control over filtering use OnFilter

Text filtering is formatted as follows:
Value Description
*TEXT* (or just TEXT) Matches strings containing "text"
TEXT* Matches strings that start with "text"
*TEXT Matches strings that end with "text"
"TEXT" Matches strings that are an exact match with "text"

Text Filtering Notes:
Filtering is case-insensitive
Folders are not filtered (use index filtering or OnFilter instead)
Only the filename and its extension is assessed, not the path


Index filtering is formatted as follows:
Value Description
#0,2,5 Show thumbs 0, 2 and 5
#5-7 Show thumbs 5, 6 and 7
#10+ Show thumbs 10 and higher
#0,2,6-7,10+ Show thumbs 0, 2, 6, 7, 10, 11, 12.

Index Filtering Notes:
Index filters must be prefixed by #
Index values are zero-based, e.g. #0 shows only the first frame, #1 shows only the second frame
Index values do NOT need to be ordered or exclusive, e.g. "#1-5, 3, 1" is acceptable


Data and numbering filtering is formatted as follows:
Value Description
>100 Value is greater than 100
>=100 Value is >= 100
=100 Value is equal to 100
<=100 Value is <= filter
<100 Value is less than filter

Data and numbering Filtering Notes:
Only supported by fields: iesbImageSize, iesbFileSize, iesbCreateDate, iesbEditDate
iesbImageSize are specifield as W x H values, e.g. >1000000 means more than one megapixel
iesbFileSize are specified as bytes, e.g. <1024 means less one KB
iesbCreateDate and iesbEditDate are specified as simple dates, e.g using DateToStr(), e.g. on a US system >=12/25/2022 would mean on or after Christmas 2022


Demo

Demo  Demos\Multi\Filtering\Filtering.dpr


Example

// Display files that start with "Image"
IEFolderMView1.Filter := 'image*';

// Display files containing "Italy" anywhere in Info text
IEFolderMView1.FilterField := iesbInfoText;
IEFolderMView1.Filter := '*italy*';

// Display any files ending in 2015
IEFolderMView1.Filter := '*2015.*';

// Display PNG files ending in 2015
IEFolderMView1.Filter := '*2015.png';

// Display PNG files
IEFolderMView1.Filter := '*.png';

// Alternatively...
IEFolderMView1.FilterField := iesbFileExtension;
IEFolderMView1.Filter := '"png"';

// Display file of index 1 (Second thumbnail)
IEFolderMView1.Filter := '#1';

// Display files containing text #1
IEFolderMView1.Filter := '*#1*';

// Display file of index 0, 2, 6, 7, 10, 11, 15, 16, 17...
IEFolderMView1.Filter := '#0,2,6-7,10-11,15+';

// Display images greater than 10 mega-pixels
IEFolderMView1.FilterField := iesbImageSize;
IEFolderMView1.Filter      := '>' + IntToStr( 10*1000*1000 );

// Display images smaller than 1KB
IEFolderMView1.FilterField := iesbFileSize;
IEFolderMView1.Filter      := '<' + IntToStr( 1024 );

// Return images modified in the last week
IEFolderMView1.FilterField := iesbEditDate;
IEFolderMView1.Filter      := '<=' + DateToStr( Now - 7 );

// Clear the filter (show all files)
IEFolderMView1.Filter := '';


See Also

FilterField
ImageFiltered
OnFilter
FilteredCount
GetUnfilteredImage