TX Text Control .NET for Windows Forms

FilterIndex Property

Property
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

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 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.

Syntax

public int FilterIndex { get; set; }

Members

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

Examples

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

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);