Public Methods
公共类 |
void |
addArc(RectF oval, float startAngle, float sweepAngle)
Add the specified arc to the path as a new contour.
将一个指定的弧形作为新的轮廓添加到 path
|
void |
addCircle(float x, float y, float radius, Path.Direction dir)
Add a closed circle contour to the path
添加一个闭合圆形轮廓到 path
|
void |
addOval(RectF oval, Path.Direction dir)
Add a closed oval contour to the path
添加一个闭合的椭圆形轮廓到 path
|
void |
addPath(Path src, float dx, float dy)
Add a copy of src to the path, offset by (dx,dy)
将源 path 拷贝一份并添加到 path(当前),dx, dy 为偏移
|
void |
addPath(Path src)
Add a copy of src to the path
将源 path 拷贝一份并添加到 path(当前)
|
void |
addPath(Path src, Matrix matrix)
Add a copy of src to the path, transformed by matrix
将源 path 拷贝一份并添加到 path(当前),由 matrix 进行转换
|
void |
addRect(float left, float top, float right, float bottom, Path.Direction dir)
Add a closed rectangle contour to the path
添加一个闭合的矩形轮廓到 path
|
void |
addRect(RectF rect, Path.Direction dir)
Add a closed rectangle contour to the path
添加一个闭合的矩形轮廓到 path
|
void |
addRoundRect(RectF rect, float[] radii, Path.Direction dir)
Add a closed round-rectangle contour to the path.
添加一个闭合的圆角矩形轮廓到 path
|
void |
addRoundRect(RectF rect, float rx, float ry, Path.Direction dir)
Add a closed round-rectangle contour to the path
添加一个闭合的圆角矩形轮廓到 path
|
void |
arcTo(RectF oval, float startAngle, float sweepAngle)
Append the specified arc to the path as a new contour.
追加指定的弧形到 path 作为一个新的轮廓
|
void |
arcTo(RectF oval, float startAngle, float sweepAngle, boolean forceMoveTo)
Append the specified arc to the path as a new contour.
追加指定的弧形到 path 作为一个新的轮廓
|
void |
close()
Close the current contour.
闭合当前轮廓
|
void |
computeBounds(RectF bounds, boolean exact)
Compute the bounds of the control points of the path, and write the answer into bounds.
计算路径的控制点的边界,并把答案写进边界
|
void |
cubicTo(float x1, float y1, float x2, float y2, float x3, float y3)
Add a cubic bezier from the last point, approaching control points (x1,y1) and (x2,y2), and ending at (x3,y3).
从上一个点添加一个三次贝塞尔曲线,经过控制点(x1, y1), (x2, y2),在(x3, y3) 结束
|
Path.FillType |
getFillType()
Return the path’s fill type.
返回 path 的填充类型
|
void |
incReserve(int extraPtCount)
Hint to the path to prepare for adding more points.
对 path 暗示将会添加更多的点
|
boolean |
isEmpty()
Returns true if the path is empty (contains no lines or curves)
当 path 为空时返回 true (包括没有线和曲线)
|
boolean |
isInverseFillType()
Returns true if the filltype is one of the INVERSE variants
如果填充类型为 INVERSE 变量的其中一种,返回 true
|
boolean |
isRect(RectF rect)
Returns true if the path specifies a rectangle.
如果 path 指定一个矩形,返回 true
|
void |
lineTo(float x, float y)
Add a line from the last point to the specified point (x,y).
从上一点到 (x, y) 画线
|
void |
moveTo(float x, float y)
Set the beginning of the next contour to the point (x,y).
将下一个轮廓的起点设置为 (x, y)
|
void |
offset(float dx, float dy, Path dst)
Offset the path by (dx,dy), returning true on success
将 path 偏移 (x, y),成功则返回 true
|
void |
offset(float dx, float dy)
Offset the path by (dx,dy), returning true on success
将 path 偏移 (x, y),成功则返回 true
|
void |
quadTo(float x1, float y1, float x2, float y2)
Add a quadratic bezier from the last point, approaching control point (x1,y1), and ending at (x2,y2).
从上一个点添加一个二次贝塞尔曲线,经过控制点(x1, y1),在(x2, y2) 结束
|
void |
rCubicTo(float x1, float y1, float x2, float y2, float x3, float y3)
Same as cubicTo, but the coordinates are considered relative to the current point on this contour.
同 cublicTo,但坐标被认为是相对于当前轮廓上的当前点。
|
void |
rLineTo(float dx, float dy)
Same as lineTo, but the coordinates are considered relative to the last point on this contour.
同 lineTo,但坐标被认为是相对于当前轮廓上的上一点。
|
void |
rMoveTo(float dx, float dy)
Set the beginning of the next contour relative to the last point on the previous contour.
设置下一个轮廓的开始点相当于上一个轮廓的最后一点
|
void |
rQuadTo(float dx1, float dy1, float dx2, float dy2)
Same as quadTo, but the coordinates are considered relative to the last point on this contour.
同 quadTo,但坐标被认为是相对于当前轮廓上的上一点。
|
void |
reset()
Clear any lines and curves from the path, making it empty.
清空 path 里面的所有线和曲线
|
void |
rewind()
Rewinds the path: clears any lines and curves from the path but keeps the internal data structure for faster reuse.
清空 path 中的所有线和曲线,但是保留其内部数据以便快速重用
|
void |
set(Path src)
Replace the contents of this with the contents of src.
用源 path 代替当前 path 的内容
|
void |
setFillType(Path.FillType ft)
Set the path’s fill type.
设置 path 填充类型
|
void |
setLastPoint(float dx, float dy)
Sets the last point of the path.
设置 path 的最后一点
|
void |
toggleInverseFillType()
Toggles the INVERSE state of the filltype
切换 filltype 的逆状态
|
void |
transform(Matrix matrix, Path dst)
Transform the points in this path by matrix, and write the answer into dst.
应用矩阵变换当前 path, 并把结果写到目的 path
|
void |
transform(Matrix matrix)
Transform the points in this path by matrix.
应用矩阵变换当前 path
|