TX Text Control .NET for WPF

ExportFilterIndex Property

Property
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.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 saved. This is the number of the filter in the string returned through the ImageCollection.ExportFilters property, beginning with number one. If the ImageCollection.ExportFilters 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. A value of zero indicates that no export format has currently be specified for the image. In this case the original format is used that can be obtained with the Image.FilterIndex property. The technical article Loading and Saving Images describes how images can be loaded and saved.

Syntax

public int ExportFilterIndex { get; set; }

Members

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

Examples

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

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

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

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