TX Text Control .NET for WPF

ImageCompressionQuality Property

Property|Introduced in 11.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Sets a value between 1 and 100, which is the quality of a lossy image compression used when a document is saved. It is used for all images in the document the data of which is compressed with a lossy compression algorithm. A value of 100 indicates the maximum quality, a value of 1 indicates the minimum quality. A value of zero selects a compression specific default value. For a single image the value of this property can be overwritten using the Image.ExportCompressionQuality property.

Syntax

public int ImageCompressionQuality { get; set; }

Examples

The following example configures how the current document is exported to WordprocessingML by using SaveSettings.ImageCompressionQuality.

textControl.Text = "Quarterly results";
SaveSettings saveSettings = new();

saveSettings.ImageCompressionQuality = 10;
Console.WriteLine($"Image Compression Quality used by Save Settings: {saveSettings.ImageCompressionQuality}");

textControl.Save("quarterly-results.docx", StreamType.WordprocessingML, saveSettings);