# TXBarcodeControl.SaveImage Method

> Saves the barcode image.

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

---

### Description

Saves the barcode image.

### Syntax

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

Saves the barcode image to the specified object of type `System.IO.Stream` with the specified format of type `System.Drawing.Imaging.ImageFormat`.

```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` into which the image is saved. |
| format | Specifies the format used to save the image. |

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

Saves the barcode image into the specified file with the specified format of type `System.Drawing.Imaging.ImageFormat`.

```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 into which the image is saved. |
| format | Specifies the format used to save the image. |

#### SaveImage(Stream, ImageFormat)

Saves the barcode image to the specified object of type `System.IO.Stream` with the specified format of type [TXTextControl.WPF.Barcode.ImageFormat](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-barcode/wpf-barcode-imageformat/enumeration/llms-full.txt).

```csharp
public void SaveImage(Stream imageStream, ImageFormat format);
```

```vbnet
Public Sub SaveImage(imageStream As Stream, format As ImageFormat)
```

| Parameter | Description |
|---|---|
| imageStream | Specifies an object of type `System.IO.Stream` into which the image is saved. |
| format | Specifies the format used to save the image. |

#### SaveImage(string, ImageFormat)

Saves the barcode image into the specified file with the specified format of type [TXTextControl.WPF.Barcode.ImageFormat](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-barcode/wpf-barcode-imageformat/enumeration/llms-full.txt).

```csharp
public void SaveImage(string imageFileName, ImageFormat format);
```

```vbnet
Public Sub SaveImage(imageFileName As String, format As ImageFormat)
```

| Parameter | Description |
|---|---|
| imageFileName | Specifies a file into which the image is saved. |
| format | Specifies the format used to save the image. |

### Examples

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

```csharp
tXBarcodeControl.SaveImage("document.docx", TXTextControl.WPF.Barcode.ImageFormat.BMP);
Console.WriteLine("TXBarcode Control is ready for use.");
```

```vbnet
tXBarcodeControl.SaveImage("document.docx", TXTextControl.WPF.Barcode.ImageFormat.BMP)
Console.WriteLine("TXBarcode Control is ready for use.")
```

---

## Nearby

- **Previous:** [TXBarcodeControl.Save Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/save-method/llms-full.txt)
- **Next:** [TXBarcodeControl.ShowText Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/showtext-property/llms-full.txt)
