# Drawing

There are 3 options that you can use to draw on the image.

* [Draw Text](https://www.telerik.com/products/winforms/documentation/controls/image-editor/features/drawing#draw-text)
* [Draw Shape](https://www.telerik.com/products/winforms/documentation/controls/image-editor/features/drawing#draw-shape)
* [Draw with a Pen](https://www.telerik.com/products/winforms/documentation/controls/image-editor/features/drawing#draw-with-a-pen)

> caption Figure 1: Draw Buttons

![WinForms RadImageEditor Draw Buttons](https://www.telerik.com/products/winforms/documentation/assets/fdc1257ba4df34ae3bf52df897b839ca/image-editor-draw001.png)

## Draw Text

To draw text click the button and the **DrawText** dialog will be shown. In it you need to provide the text and set various other options.

> caption Figure 2: DrawText Dialog

![WinForms RadImageEditor DrawText Dialog](https://www.telerik.com/products/winforms/documentation/assets/2d9f3eb48bc18aa92b773694c7bfe75c/image-editor-draw002.png)

### Drawing text programmatically

The following snippet shows how you can add text using the RadImageEditor API.

```C#
radImageEditor1.ImageEditorElement.DrawString("Test", 12, Color.Red, 200, 200, 120);
radImageEditor1.ImageEditorElement.SaveState();
```

```VB.NET
radImageEditor1.ImageEditorElement.DrawString("Test", 12, Color.Red, 200, 200, 120)
radImageEditor1.ImageEditorElement.SaveState()
```

## Draw Shape

When the Draw Shape button is pressed the DrawShape dialog appears. In this dialog you can specify the type and the size of the shape. You can set its colors as well.

> caption Figure 3: DrawShape Dialog

![WinForms RadImageEditor DrawShape Dialog](https://www.telerik.com/products/winforms/documentation/assets/7a192742b163e5e455e1fd478eb67a5f/image-editor-draw005.png)

Once you are ready with the settings you can draw your shape with the mouse.

> caption Figure 4: Drawing Shapes

![WinForms RadImageEditor Drawing Shapes](https://www.telerik.com/products/winforms/documentation/assets/2b50e4957731c0f78e1f9411b420cbe8/image-editor-draw003.png)

The currently supported shapes are:

* FreeFlow
* Rectangle
* Square
* Ellipse
* Circle
* Arrow

### Draw Shape Programmatically

To draw a shape in the code behind you need to provide a path. The bellow code demonstrates how you ca create a RoundRectShape:

```C#
RoundRectShape shape = new RoundRectShape();
Rectangle rect = new Rectangle(0, 0, 100, 100);
var path = shape.CreatePath(rect);
radImageEditor1.ImageEditorElement.DrawShape(path, Color.Red, Color.Green, 3);
radImageEditor1.ImageEditorElement.SaveState();
```

```VB.NET
Dim shape As New RoundRectShape()
Dim rect As New Rectangle(0, 0, 100, 100)
Dim path = shape.CreatePath(rect)
radImageEditor1.ImageEditorElement.DrawShape(path, Color.Red, Color.Green, 3)
radImageEditor1.ImageEditorElement.SaveState()
```

## Draw with a Pen

When the Draw button is pressed the Draw dialog appears. In this dialog you can specify the size and the color of the brush. One you are done you can directly star drawing on the image surface.

> caption Figure 1: Draw Dialog

![WinForms RadImageEditor Draw Dialog](https://www.telerik.com/products/winforms/documentation/assets/cc7dd352c5e1dee7c79aa78938965a4a/image-editor-draw004.png)

## See Also

* [Getting Started](https://www.telerik.com/products/winforms/documentation/controls/image-editor/getting-started)
* [Structure](https://www.telerik.com/products/winforms/documentation/controls/image-editor/structure)
* [Properties and Events](https://www.telerik.com/products/winforms/documentation/controls/image-editor/properties-and-events)
