# TXDrawingControl.SaveImage Method

> Saves the displayed shapes as an image.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.WPF.Drawing`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDrawing.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDrawing.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF.Drawing > TXDrawingControl.SaveImage Method
- **706 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/saveimage-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/saveimage-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/saveimage-method/llms-full.txt

---

### Description

Saves the displayed [shapes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapes-property/llms-full.txt) 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`.

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

```vbnet
Public Sub SaveImage(imageStream As Stream, format As System.Drawing.Imaging.ImageFormat)
```

| Parameter | Description |
|---|---|
| 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.

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

```vbnet
Public Sub SaveImage(imageFileName As String, format As System.Drawing.Imaging.ImageFormat)
```

| Parameter | Description |
|---|---|
| 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.

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

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

---

## Nearby

- **Previous:** [TXDrawingControl.Save Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/save-method/llms-full.txt)
- **Next:** [TXDrawingControl.SelectAll Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/selectall-method/llms-full.txt)
