## FillRectangle(Brush, Rectangle) {#fillrectangle}

Fills the interior of a rectangle specified by a [`Rectangle`](../../rectangle/) structure.

```csharp
public void FillRectangle(Brush brush, Rectangle rect)
```

| Parameter | Type | Description |
| --- | --- | --- |
| brush | Brush | [`Brush`](../../brush/) that determines the characteristics of the fill. |
| rect | Rectangle | [`Rectangle`](../../rectangle/) structure that represents the rectangle to fill. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *brush* is null. |

### See Also

* class [Brush](../../brush/)
* struct [Rectangle](../../rectangle/)
* class [Graphics](../)
* namespace [Aspose.Imaging](../../graphics/)
* assembly [Aspose.Imaging](../../../)

---

## FillRectangle(Brush, RectangleF) {#fillrectangle_1}

Fills the interior of a rectangle specified by a [`RectangleF`](../../rectanglef/) structure.

```csharp
public void FillRectangle(Brush brush, RectangleF rect)
```

| Parameter | Type | Description |
| --- | --- | --- |
| brush | Brush | [`Brush`](../../brush/) that determines the characteristics of the fill. |
| rect | RectangleF | [`RectangleF`](../../rectanglef/) structure that represents the rectangle to fill. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *brush* is null. |

### See Also

* class [Brush](../../brush/)
* struct [RectangleF](../../rectanglef/)
* class [Graphics](../)
* namespace [Aspose.Imaging](../../graphics/)
* assembly [Aspose.Imaging](../../../)

---

## FillRectangle(Brush, float, float, float, float) {#fillrectangle_3}

Fills the interior of a rectangle specified by a pair of coordinates, a width and a height.

```csharp
public void FillRectangle(Brush brush, float x, float y, float width, float height)
```

| Parameter | Type | Description |
| --- | --- | --- |
| brush | Brush | [`Brush`](../../brush/) that determines the characteristics of the fill. |
| x | Single | The x-coordinate of the upper-left corner of the rectangle to fill. |
| y | Single | The y-coordinate of the upper-left corner of the rectangle to fill. |
| width | Single | Width of the rectangle to fill. |
| height | Single | Height of the rectangle to fill. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *brush* is null. |

### See Also

* class [Brush](../../brush/)
* class [Graphics](../)
* namespace [Aspose.Imaging](../../graphics/)
* assembly [Aspose.Imaging](../../../)

---

## FillRectangle(Brush, int, int, int, int) {#fillrectangle_2}

Fills the interior of a rectangle specified by a pair of coordinates, a width and a height.

```csharp
public void FillRectangle(Brush brush, int x, int y, int width, int height)
```

| Parameter | Type | Description |
| --- | --- | --- |
| brush | Brush | [`Brush`](../../brush/) that determines the characteristics of the fill. |
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle to fill. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle to fill. |
| width | Int32 | Width of the rectangle to fill. |
| height | Int32 | Height of the rectangle to fill. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *brush* is null. |

### See Also

* class [Brush](../../brush/)
* class [Graphics](../)
* namespace [Aspose.Imaging](../../graphics/)
* assembly [Aspose.Imaging](../../../)


