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

获取适合当前图像的矩形。

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

| 范围 | 类型 | 描述 |
| --- | --- | --- |
| rectangle | Rectangle | 要为其拟合矩形的矩形。 |
| width | Int32 | 对象宽度。 |
| height | Int32 | 物体高度。 |

### 返回值

拟合矩形或找不到拟合矩形时的异常。

### 也可以看看

* struct [Rectangle](../../rectangle/)
* class [Image](../)
* 命名空间 [Aspose.PSD](../../image/)
* 部件 [Aspose.PSD](../../../)

---

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

获取适合当前图像的矩形。

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

| 范围 | 类型 | 描述 |
| --- | --- | --- |
| rectangle | Rectangle | 要为其拟合矩形的矩形。 |
| pixels | Int32[] | 32 位 ARGB 像素。 |
| width | Int32 | 对象宽度。 |
| height | Int32 | 物体高度。 |

### 返回值

拟合矩形或找不到拟合矩形时的异常。

### 也可以看看

* struct [Rectangle](../../rectangle/)
* class [Image](../)
* 命名空间 [Aspose.PSD](../../image/)
* 部件 [Aspose.PSD](../../../)


