# SetImageFilters
{: .no_toc }

Replaces the [**Filter**](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/Filter.md) with pairs for image files.

Syntax: *object*.**SetImageFilters**

*object*
: *required* An object expression that evaluates to a **cDialog**.

## Remarks

**SetImageFilters** calls [**ClearFilter**](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/ClearFilter.md), so any earlier filter is lost, and then [**AddFilter**](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/AddFilter.md) for each pair:

| Description | Pattern |
|---|---|
| `Bitmap Files (*.bmp)` | `*.bmp` |
| `JPEG Files (*.jpg;*.jpeg)` | `*.jpg;*.jpeg` |
| `PNG Files (*.png)` | `*.png` |
| `GIF Files (*.gif)` | `*.gif` |
| `All Image Files (*.bmp;*.jpg;*.jpeg;*.png;*.gif)` | `*.bmp;*.jpg;*.jpeg;*.png;*.gif` |
| `All Files (*.*)` | `*.*` |

The descriptions are fixed English text. To show other text, build the filter with [**AddFilter**](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/AddFilter.md). The file-type list of the dialog holds the six descriptions in this order. The first, Bitmap Files, is the one that is selected when the dialog opens, not All Image Files, which is the fifth.

## Example

```tb check_build check_run
Dim dlg As New cDialog
Dim parts() As String
Dim pairCount As Long

dlg.AddFilter "Old", "*.old"
dlg.SetImageFilters

parts = Split(dlg.Filter, "|")
pairCount = (UBound(parts) + 1) \ 2
Debug.Print pairCount   ' 6
Debug.Print parts(0)    ' Bitmap Files (*.bmp)
Debug.Print parts(1)    ' *.bmp
```

## See Also

- [SetCommonFilters](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/SetCommonFilters.md) method -- text files
- [SetDocumentFilters](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/SetDocumentFilters.md) method -- office documents
- [SetCodeFilters](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/SetCodeFilters.md) method -- source code files
- [Filter](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/Filter.md) property -- the whole list as one string
- [cDialog](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/index.md) class -- overview
