RelativeRectangle
概述
RelativeRectangle 是 Aspose.3D FOSS 中用于 Java 的一个类。继承自:Struct<RelativeRectangle>,Serializable。
相对矩形 将相对组件转换为绝对值的公式为:Scale *(Reference Width)+ offset。因此,如果我们希望它表示绝对值,请将所有 scale 字段设为零,并改用 offset 字段。
此类提供了 25 种方法用于在 Java 程序中处理 RelativeRectangle 对象。可用的方法包括:RelativeRectangle、clone、copyFrom、equals、fromScale、getOffsetHeight、getOffsetWidth、getOffsetX、getOffsetY、getScaleHeight、getScaleWidth、getScaleX,以及另外 12 种方法。安装 Aspose.3D FOSS for Java 包后,所有公共成员对任何 Java 应用程序均可访问。属性:offsetHeight、offsetWidth、offsetX、offsetY、scaleHeight、scaleWidth,以及另外 2 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
scaleX | float | 读取 | 相对坐标 X @return 相对坐标 X / |
scaleY | float | 读取 | 相对坐标 Y @return 相对坐标 Y / |
scaleWidth | float | 读取 | 相对宽度 @return 相对宽度 / |
scaleHeight | float | 读取 | 相对高度 @return 相对高度 / |
offsetX | int | 读取 | 获取坐标 X 的偏移量 @return 坐标 X 的偏移量 / |
offsetY | int | 读取 | 获取坐标 Y 的偏移量 @return 坐标 Y 的偏移量 / |
offsetWidth | int | 读取 | 获取宽度的偏移量 @return 宽度的偏移量 |
offsetHeight | int | 读取 | 获取高度的偏移量 @return 高度的偏移量 / |
方法
| 签名 | 描述 |
|---|---|
RelativeRectangle() | 在此 RelativeRectangle 实例上调用 RelativeRectangle。 |
RelativeRectangle(left: int, top: int, width: int, height: int) | 在此 RelativeRectangle 实例上调用 RelativeRectangle(left, top, width, height)。 |
getScaleX() → float | 相对坐标 X @return 相对坐标 X / |
setScaleX(value: float) | 相对坐标 X @param value 新值 / |
getScaleY() → float | 相对坐标 Y @return 相对坐标 Y / |
setScaleY(value: float) | 相对坐标 Y @param value 新值 / |
getScaleWidth() → float | 相对宽度 @return Relative width / |
setScaleWidth(value: float) | 相对宽度 @param value 新值 / |
getScaleHeight() → float | 相对高度 @return Relative height / |
setScaleHeight(value: float) | 相对高度 @param value 新值 / |
getOffsetX() → int | 获取坐标 X 的偏移量 @return 坐标 X 的偏移量 / |
setOffsetX(value: int) | 设置坐标 X 的偏移量 @param value 新的值 |
getOffsetY() → int | 获取坐标 Y 的偏移量 @return 坐标 Y 的偏移量 / |
setOffsetY(value: int) | 设置 Y 坐标的偏移量 @param value 新值 |
getOffsetWidth() → int | 获取宽度的偏移量 @return 宽度的偏移量 |
setOffsetWidth(value: int) | 设置宽度的偏移 @param value 新值 |
getOffsetHeight() → int | 获取高度的偏移量 @return 高度的偏移量 / |
setOffsetHeight(value: int) | 设置高度的偏移量 @param value 新值 |
toAbsolute(left: int, top: int, width: int, height: int) → Rect | 将相对矩形转换为绝对矩形 @param left 矩形的左边 @param top 矩形的顶部 @param width 矩形的宽度 @param height 矩形的高度 @r |
fromScale(scaleX: float, scaleY: float, scaleWidth: float, scaleHeight: float) → RelativeRectangle | 使用所有偏移字段为零、缩放字段来自给定参数的方式构造一个 RelativeRectangle。 |
toString() → String | 对该 RelativeRectangle 实例调用 toString。 |
clone() → RelativeRectangle | 在此 RelativeRectangle 实例上调用 clone。 |
copyFrom(src: RelativeRectangle) | 在此 RelativeRectangle 实例上调用 copyFrom(src)。 |
hashCode() → int | 在此 RelativeRectangle 实例上调用 hashCode。 |
equals(obj: Object) → boolean | 在此 RelativeRectangle 实例上调用 equals(obj)。 |