ImageSaveMode Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Determines whether the document's images are stored through its data or through its file reference. By default images are stored through a file reference, when a file reference exists. Otherwise, if an image has been pasted from the clipboard, it is stored with its binary data. For a single image the value of this property can be overwritten with the Image.SaveMode property. The technical article Loading and Saving Images gives an overview how to export images.
Syntax
public ImageSaveMode ImageSaveMode { get; set; }Public Property ImageSaveMode As ImageSaveModeMembers
| Value | Description |
|---|---|
| Auto | An image is saved with a file reference, when a file reference exists. Otherwise it is saved with its binary data. |
| SaveAsData | The document's images are saved with their binary data. |
| SaveAsFileReference | The document's images are saved through file references. |
Examples
The following example configures how the current document is exported to WordprocessingML by using SaveSettings.ImageSaveMode.
textControl.Text = "Quarterly results";
SaveSettings saveSettings = new();
saveSettings.ImageSaveMode = ImageSaveMode.Auto;
Console.WriteLine($"Image Save Mode used by Save Settings: {saveSettings.ImageSaveMode}");
textControl.Save("quarterly-results.docx", StreamType.WordprocessingML, saveSettings);textControl.Text = "Quarterly results"
Dim saveSettings As New SaveSettings()
saveSettings.ImageSaveMode = ImageSaveMode.Auto
Console.WriteLine($"Image Save Mode used by Save Settings: {saveSettings.ImageSaveMode}")
textControl.Save("quarterly-results.docx", StreamType.WordprocessingML, saveSettings)