# TXDrawingControl.SetCanvasSize Method

> Specifies, pursuant to a ZoomFactor value of 100, the height and width of the canvas. The parameters must be given in twips.

- **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.SetCanvasSize Method
- **427 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/setcanvassize-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/setcanvassize-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/setcanvassize-method/llms-full.txt

---

### Description

Specifies, pursuant to a [ZoomFactor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/zoomfactor-property/llms-full.txt) value of 100, the height and width of the canvas. The parameters must be given in twips.

### Syntax

```csharp
public void SetCanvasSize(double width, double height);
```

```vbnet
Public Sub SetCanvasSize(width As Double, height As Double)
```

### Parameters

| Parameter | Description |
|---|---|
| width | Specifies the width of the canvas. |
| height | Specifies the height of the canvas. |

### Examples

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

```csharp
tXDrawingControl.SetCanvasSize(1.0, 1.0);
Console.WriteLine("TXDrawing Control is ready for use.");
```

```vbnet
tXDrawingControl.SetCanvasSize(1.0, 1.0)
Console.WriteLine("TXDrawing Control is ready for use.")
```

---

## Nearby

- **Previous:** [TXDrawingControl.Selection Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/selection-property/llms-full.txt)
- **Next:** [TXDrawingControl.ShapeAdjusted Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapeadjusted-event/llms-full.txt)
