TX Text Control .NET Server

ImageCompressionQuality Property

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

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