|
Foxit PDF SDK for HarmonyOS
3.0
|
Public Member Functions | |
| centerX () | |
| centerY () | |
| constructor (l, t, r, b) convertToFGRect() | |
| contains (x, y) | |
| containsRect (r) | |
| equals (r) | |
| height () | |
| inset (dx, dy) | |
| intersect (left, top, right, bottom) | |
| intersectRect (r) | |
| intersects (left, top, right, bottom) | |
| offset (dx, dy) | |
| get | origin () |
| set | origin (pt) get size() |
| round () | |
| roundOut () | |
| setEmpty () | |
| set | size (size) setRect(rect) set(l |
| sort () | |
| toString () | |
| union (x, y) | |
| vp2px (context) trunc() | |
| set b | width () |
Static Public Member Functions | |
| static | intersects (a, b) |
RectF类,表示一个浮点数值的矩形区域 用于处理矩形相关的几何计算和坐标转换
| FoxitPDFViewCtrl.RectF.centerX | ( | ) |
获取矩形水平中心坐标
| FoxitPDFViewCtrl.RectF.centerY | ( | ) |
获取矩形垂直中心坐标
| FoxitPDFViewCtrl.RectF.constructor | ( | l | , |
| t | , | ||
| r | , | ||
| b | |||
| ) |
构造函数
| l | 左边界坐标(可选) |
| t | 上边界坐标(可选) |
| r | 右边界坐标(可选) |
| b | 下边界坐标(可选) 将当前矩形转换为GeometryUtil.FGRect对象 |
| FoxitPDFViewCtrl.RectF.contains | ( | x | , |
| y | |||
| ) |
判断点是否在矩形内
| x | 点的X坐标 |
| y | 点的Y坐标 |
| FoxitPDFViewCtrl.RectF.containsRect | ( | r | ) |
判断当前矩形是否完全包含指定矩形
| r | 要检测的矩形对象 |
| FoxitPDFViewCtrl.RectF.equals | ( | r | ) |
判断两个矩形是否相等
| r | 要比较的矩形对象 |
| FoxitPDFViewCtrl.RectF.height | ( | ) |
计算矩形高度
| FoxitPDFViewCtrl.RectF.inset | ( | dx | , |
| dy | |||
| ) |
内缩矩形区域
| dx | 水平方向缩进量 |
| dy | 垂直方向缩进量 |
| FoxitPDFViewCtrl.RectF.intersect | ( | left | , |
| top | , | ||
| right | , | ||
| bottom | |||
| ) |
计算当前矩形与指定矩形的交集区域
该方法将当前矩形调整为与传入矩形相交的部分,并返回是否存在有效交集。 当两个矩形存在重叠区域时,当前矩形的各边界会被调整为重叠区域的对应边界值。
| left | - 目标矩形的左边界坐标 |
| top | - 目标矩形的上边界坐标 |
| right | - 目标矩形的右边界坐标 |
| bottom | - 目标矩形的下边界坐标 |
| FoxitPDFViewCtrl.RectF.intersectRect | ( | r | ) |
与另一个矩形求交集(修改当前矩形)
| r | 目标矩形 |
|
static |
静态方法判断两个矩形是否相交
| a | 第一个矩形 |
| b | 第二个矩形 |
| FoxitPDFViewCtrl.RectF.intersects | ( | left | , |
| top | , | ||
| right | , | ||
| bottom | |||
| ) |
判断当前矩形是否与指定矩形相交
| left | 待检测矩形左边界 |
| top | 待检测矩形上边界 |
| right | 待检测矩形右边界 |
| bottom | 待检测矩形下边界 |
| FoxitPDFViewCtrl.RectF.offset | ( | dx | , |
| dy | |||
| ) |
偏移矩形位置
| dx | 水平偏移量 |
| dy | 垂直偏移量 |
| get FoxitPDFViewCtrl.RectF.origin | ( | ) |
获取矩形原点坐标
| set FoxitPDFViewCtrl.RectF.origin | ( | pt | ) |
设置矩形原点坐标
| pt | 新的原点坐标 获取矩形尺寸 |
| FoxitPDFViewCtrl.RectF.round | ( | ) |
四舍五入取整矩形坐标
| FoxitPDFViewCtrl.RectF.roundOut | ( | ) |
向外取整矩形坐标(左/上取地板值,右/下取天花板值)
| FoxitPDFViewCtrl.RectF.setEmpty | ( | ) |
将矩形重置为空(所有坐标设为0)
| set FoxitPDFViewCtrl.RectF.size | ( | size | ) |
通过尺寸设置矩形右/下边界
| size | 新的尺寸对象 设置矩形坐标(通过另一个RectF对象) |
| rect | 源矩形对象 设置矩形坐标(通过四个数值) |
| l | 左边界 |
| t | 上边界 |
| r | 右边界 |
| b | 下边界 |
| FoxitPDFViewCtrl.RectF.sort | ( | ) |
规范化矩形坐标(确保left<=right且top<=bottom)
| FoxitPDFViewCtrl.RectF.toString | ( | ) |
获取矩形字符串表示
| FoxitPDFViewCtrl.RectF.union | ( | x | , |
| y | |||
| ) |
扩展矩形以包含指定点
| x | 要包含的点的X坐标 |
| y | 要包含的点的Y坐标 |
| FoxitPDFViewCtrl.RectF.vp2px | ( | context | ) |
vp2px
| context | 可选UI上下文 |
| set b FoxitPDFViewCtrl.RectF.width | ( | ) |
计算矩形宽度