RectangleExtensions
Inheritance: java.lang.Object
public final class RectangleExtensions
包含 Rectangle 的扩展方法。
方法
| 方法 | 描述 |
|---|---|
| toGdiRectangle(Rectangle rectangle) | 将 Rectangle 转换为 System.Drawing.Rectangle。 |
| toGdiRectangle(RectangleF rectangle) | 将 RectangleF 转换为 System.Drawing.Rectangle。 |
| unionWith(RectangleF rectangle, RectangleF otherRectangle) | 合并两个矩形。 |
toGdiRectangle(Rectangle rectangle)
public static Rectangle toGdiRectangle(Rectangle rectangle)
将 Rectangle 转换为 System.Drawing.Rectangle。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| rectangle | Rectangle | 要转换的矩形。 |
Returns:
Rectangle - The converted System.Drawing.Rectangle.
toGdiRectangle(RectangleF rectangle)
public static Rectangle2D.Float toGdiRectangle(RectangleF rectangle)
将 RectangleF 转换为 System.Drawing.Rectangle。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| rectangle | RectangleF | 要转换的矩形。 |
Returns:
java.awt.geom.Rectangle2D.Float - 已转换的 System.Drawing.RectangleF。
unionWith(RectangleF rectangle, RectangleF otherRectangle)
public static RectangleF unionWith(RectangleF rectangle, RectangleF otherRectangle)
合并两个矩形。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| rectangle | RectangleF | 第一个矩形。 |
| otherRectangle | RectangleF | 第二个矩形。 |
Returns: RectangleF - New rectangle as union operation result