## Graphics::DrawRectangle(const SharedPtr\<Pen\>\&, float, float, float, float) method


在当前对象所表示的表面上使用指定的笔绘制指定的矩形。

```cpp
void System::Drawing::Graphics::DrawRectangle(const SharedPtr<Pen> &pen, float x, float y, float width, float height)
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| pen | const SharedPtr\<Pen\>\& | 绘制矩形时使用的笔 |
| x | 单精度浮点数 | 要绘制的矩形左上角的 X 坐标 |
| y | 单精度浮点数 | 要绘制的矩形左上角的 Y 坐标 |
| width | 单精度浮点数 | 要绘制的矩形的宽度 |
| height | 单精度浮点数 | 要绘制的矩形的高度 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Pen](../../pen/)
* Class [Graphics](../)
* Namespace [System::Drawing](../../)
* Library [Aspose.Page for C++](../../../)
## Graphics::DrawRectangle(const SharedPtr\<Pen\>\&, int, int, int, int) method


在当前对象所表示的表面上使用指定的笔绘制指定的矩形。

```cpp
void System::Drawing::Graphics::DrawRectangle(const SharedPtr<Pen> &pen, int x, int y, int width, int height)
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| pen | const SharedPtr\<Pen\>\& | 绘制矩形时使用的笔 |
| x | int | 要绘制的矩形左上角的 X 坐标 |
| y | int | 要绘制的矩形左上角的 Y 坐标 |
| width | int | 要绘制的矩形的宽度 |
| height | int | 要绘制的矩形的高度 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Pen](../../pen/)
* Class [Graphics](../)
* Namespace [System::Drawing](../../)
* Library [Aspose.Page for C++](../../../)
## Graphics::DrawRectangle(const SharedPtr\<Pen\>\&, Rectangle) method


在当前对象所表示的表面上使用指定的笔绘制指定的矩形。

```cpp
void System::Drawing::Graphics::DrawRectangle(const SharedPtr<Pen> &pen, Rectangle rect)
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| pen | const SharedPtr\<Pen\>\& | 绘制矩形时使用的笔 |
| rect | Rectangle | 一个 [Rectangle](../../rectangle/) 对象，用于指定要绘制的矩形的位置和大小 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Pen](../../pen/)
* Class [Rectangle](../../rectangle/)
* Class [Graphics](../)
* Namespace [System::Drawing](../../)
* Library [Aspose.Page for C++](../../../)
