TX Text Control .NET for WPF

SaveMode Property

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

Description

Determines whether the image is stored through its data or through its file reference. By default an image is stored through a file reference if a file reference exists. Otherwise, if the image has been pasted from the clipboard, it is stored with its complete binary data.

Syntax

public ImageSaveMode SaveMode { get; set; }

Members

ValueDescription
AutoThe image is saved as specified with the SaveSettings.ImageSaveMode property.
SaveAsDataThe image is saved in a Text Control document with its complete binary data.
SaveAsFileReferenceThe image is saved in a Text Control document through a file reference.

Examples

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

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

image.SaveMode = ImageSaveMode.Auto;
Console.WriteLine($"Save Mode used by Image: {image.SaveMode}");

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

Further Reading

  • Embedding Images in Various Formats –