# Image.FilterIndex Property

> Gets or sets the format used, if an image is inserted. This is the number of the filter in the string returned through the ImageCollection.ImportFilters property, beginning with number one. If the ImageCollection.ImportFilters property is used to initialize the FileDialog.Filter property of a Framework dialog, the FileDialog.FilterIndex property can be used as value for this property. The technical article Loading and Saving Images describes how images can be loaded and saved.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > Image.FilterIndex Property
- **793 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/image/filterindex-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/image/filterindex-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/image/filterindex-property/llms-full.txt

---

### Description

Gets or sets the format used, if an image is inserted. This is the number of the filter in the string returned through the [ImageCollection.ImportFilters](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/imagecollection/importfilters-property/llms-full.txt) property, beginning with number one. If the [ImageCollection.ImportFilters](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/imagecollection/importfilters-property/llms-full.txt) property is used to initialize the FileDialog.Filter property of a Framework dialog, the FileDialog.FilterIndex property can be used as value for this property. The technical article Loading and Saving Images describes how images can be loaded and saved.

### Syntax

```csharp
public int FilterIndex { get; set; }
```

```vbnet
Public Property FilterIndex As Integer
```

### Members

| Value | Description |
|---|---|
| 1 | Windows Bitmap (.BMP) |
| 2 | Tagged Image Format (.TIF) |
| 3 | Windows Metafile (.WMF) |
| 4 | Portable Network Graphics (.PNG) |
| 5 | JPEG File Interchange Format (.JPG, .JPEG) |
| 6 | Graphics Interchange Format (.GIF) |
| 7 | Windows Enhanced Metafile (.EMF) |
| 8 | Scalable Vector Graphics (.SVG) |

### Examples

The following example inserts and configures a named, accessible company logo by using `Image.FilterIndex`.

```csharp
TXTextControl.Image image = new() { FileName = @"Images\company-logo.png", Name = "CompanyLogo" };
textControl.Images.Add(image, -1);

image.FilterIndex = 1;
Console.WriteLine($"Filter Index used by Image: {image.FilterIndex}");

textControl.Save("report-with-logo.docx", StreamType.WordprocessingML);
```

```vbnet
Dim image As New TXTextControl.Image() With { .FileName = "Images\company-logo.png", .Name = "CompanyLogo" }
textControl.Images.Add(image, -1)

image.FilterIndex = 1
Console.WriteLine($"Filter Index used by Image: {image.FilterIndex}")

textControl.Save("report-with-logo.docx", StreamType.WordprocessingML)
```

---

## Nearby

- **Previous:** [Image.FileName Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/image/filename-property/llms-full.txt)
- **Next:** [Image.HorizontalScaling Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/image/horizontalscaling-property/llms-full.txt)
