TX Text Control .NET for WPF

SaveImage Method

Method|Introduced in 23.0
Namespace
TXTextControl.WPF.Drawing
Package
TXTextControl.TextControl.WPF.SDK as TXDrawing.WPF.dll from the private NuGet feed or Text Control Offline Packages

Description

Saves the displayed shapes as an image.

Syntax

SaveImage(Stream, System.Drawing.Imaging.ImageFormat)

Saves the displayed shapes as an image to the specified object of type System.IO.Stream.

public void SaveImage(Stream imageStream, System.Drawing.Imaging.ImageFormat format);
ParameterDescription
imageStream

Specifies an object of type System.IO.Stream the image is saved to.

format

Specifies the format used to save the image.

SaveImage(string, System.Drawing.Imaging.ImageFormat)

Saves the displayed shapes as an image to the specified file using the specified format.

public void SaveImage(string imageFileName, System.Drawing.Imaging.ImageFormat format);
ParameterDescription
imageFileName

Specifies a file the image is saved to.

format

Specifies the format used to save the image.

Examples

The following example uses Save Image in a focused TXDrawing Control workflow. The created object is then available to the surrounding document workflow.

tXDrawingControl.SaveImage("document.docx", System.Drawing.Imaging.ImageFormat.Png);
Console.WriteLine("TXDrawing Control is ready for use.");