## GetFittingRectangle(Rectangle, int, int) {#getfittingrectangle}

Gets rectangle which fits the current image.

```csharp
public static Rectangle GetFittingRectangle(Rectangle rectangle, int width, int height)
```

| Parameter | Type | Description |
| --- | --- | --- |
| rectangle | Rectangle | The rectangle to get fitting rectangle for. |
| width | Int32 | The object width. |
| height | Int32 | The object height. |

### Return Value

The fitting rectangle or exception if no fitting rectangle can be found.

### See Also

* struct [Rectangle](../../rectangle/)
* class [Image](../)
* namespace [Aspose.Imaging](../../image/)
* assembly [Aspose.Imaging](../../../)

---

## GetFittingRectangle(Rectangle, int[], int, int) {#getfittingrectangle_1}

Gets rectangle which fits the current image.

```csharp
public static Rectangle GetFittingRectangle(Rectangle rectangle, int[] pixels, int width, 
    int height)
```

| Parameter | Type | Description |
| --- | --- | --- |
| rectangle | Rectangle | The rectangle to get fitting rectangle for. |
| pixels | Int32[] | The 32-bit ARGB pixels. |
| width | Int32 | The object width. |
| height | Int32 | The object height. |

### Return Value

The fitting rectangle or exception if no fitting rectangle can be found.

### See Also

* struct [Rectangle](../../rectangle/)
* class [Image](../)
* namespace [Aspose.Imaging](../../image/)
* assembly [Aspose.Imaging](../../../)


