
**Summary:** Contains extension methods for [Rectangle](/psd/python-net/aspose.psd/rectangle/).

**Module:** [aspose.psd.extensions](/psd/python-net/aspose.psd.extensions/)

**Full Name:** aspose.psd.extensions.RectangleExtensions

**Aspose.PSD Version:** 24.12.0

## **Methods**
| **Name** | **Description** |
| :- | :- |
| [to_gdi_rectangle(rectangle)](#to_gdi_rectangle_rectangle_1) | Converts the [Rectangle](/psd/python-net/aspose.psd/rectangle/) to the . |
| [to_gdi_rectangle(rectangle)](#to_gdi_rectangle_rectangle_2) | Converts the [Rectangle](/psd/python-net/aspose.psd/rectangle/) to the . |
| [union_with(rectangle, other_rectangle)](#union_with_rectangle_other_rectangle_3) | Unions two rectangle. |


### Method: to_gdi_rectangle(rectangle)  [static] {#to_gdi_rectangle_rectangle_1}


```
 to_gdi_rectangle(rectangle) 
```

Converts the [Rectangle](/psd/python-net/aspose.psd/rectangle/) to the .

**Parameters:**

| Parameter | Type | Description |
| :- | :- | :- |
| rectangle | [Rectangle](/psd/python-net/aspose.psd/rectangle) | The rectangle to convert. |

**Returns**

| Type | Description |
| :- | :- |
| System.Drawing.Rectangle | The converted . |


### Method: to_gdi_rectangle(rectangle)  [static] {#to_gdi_rectangle_rectangle_2}


```
 to_gdi_rectangle(rectangle) 
```

Converts the [Rectangle](/psd/python-net/aspose.psd/rectangle/) to the .

**Parameters:**

| Parameter | Type | Description |
| :- | :- | :- |
| rectangle | [RectangleF](/psd/python-net/aspose.psd/rectanglef) | The rectangle to convert. |

**Returns**

| Type | Description |
| :- | :- |
| System.Drawing.RectangleF | The converted . |


### Method: union_with(rectangle, other_rectangle)  [static] {#union_with_rectangle_other_rectangle_3}


```
 union_with(rectangle, other_rectangle) 
```

Unions two rectangle.

**Parameters:**

| Parameter | Type | Description |
| :- | :- | :- |
| rectangle | [RectangleF](/psd/python-net/aspose.psd/rectanglef) | The first rectangle. |
| other_rectangle | [RectangleF](/psd/python-net/aspose.psd/rectanglef) | The second rectangle. |

**Returns**

| Type | Description |
| :- | :- |
| [RectangleF](/psd/python-net/aspose.psd/rectanglef) | New rectangle as union operation result |


