## DrawRectangle(Pen, int, int, int, int) {#drawrectangle_1}

Draws a rectangle specified by a coordinate pair, a width, and a height.

```csharp
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
```

| Parameter | Type | Description |
| --- | --- | --- |
| pen | Pen | Pen that determines the color, width, and style of the rectangle. |
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle to draw. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle to draw. |
| width | Int32 | Width of the rectangle to draw. |
| height | Int32 | Height of the rectangle to draw. |

### See Also

* class [Pen](../../pen/)
* class [Graphics](../)
* namespace [Aspose.Drawing](../../graphics/)
* assembly [Aspose.Drawing.Common](../../../)

---

## DrawRectangle(Pen, Rectangle) {#drawrectangle}

Draws a rectangle specified by a Rectangle structure.

```csharp
public void DrawRectangle(Pen pen, Rectangle rect)
```

| Parameter | Type | Description |
| --- | --- | --- |
| pen | Pen | A Pen that determines the color, width, and style of the rectangle. |
| rect | Rectangle | A Rectangle structure that represents the rectangle to draw. |

### See Also

* class [Pen](../../pen/)
* struct [Rectangle](../../rectangle/)
* class [Graphics](../)
* namespace [Aspose.Drawing](../../graphics/)
* assembly [Aspose.Drawing.Common](../../../)

---

## DrawRectangle(Pen, float, float, float, float) {#drawrectangle_2}

Draws a rectangle specified by a coordinate pair, a width, and a height.

```csharp
public void DrawRectangle(Pen pen, float x, float y, float width, float height)
```

| Parameter | Type | Description |
| --- | --- | --- |
| pen | Pen | A Pen that determines the color, width, and style of the rectangle. |
| x | Single | The x-coordinate of the upper-left corner of the rectangle to draw. |
| y | Single | The y-coordinate of the upper-left corner of the rectangle to draw. |
| width | Single | The width of the rectangle to draw. |
| height | Single | The height of the rectangle to draw. |

### See Also

* class [Pen](../../pen/)
* class [Graphics](../)
* namespace [Aspose.Drawing](../../graphics/)
* assembly [Aspose.Drawing.Common](../../../)


