Skip to content

Commit adf9899

Browse files
committed
Update
1 parent b53a7e4 commit adf9899

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

‎CustomView/Advance/[8]Path_Play.md‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,40 @@
88
可以看到,在经过
99
[Path之基本操作](https://github.com/GcsSloop/AndroidNote/blob/master/CustomView/Advance/%5B5%5DPath_Basic.md)
1010
[Path之贝塞尔曲线](https://github.com/GcsSloop/AndroidNote/blob/master/CustomView/Advance/%5B6%5DPath_Bezier.md) 和
11-
[Path之完结篇(伪)](https://github.com/GcsSloop/AndroidNote/blob/master/CustomView/Advance/%5B7%5DPath_Over.md) 后, Path中各类方法基本上都讲完了,表格中还没有讲解到到方法就是矩阵变换了,难道本篇终于要讲解矩阵了?
11+
[Path之完结篇(伪)](https://github.com/GcsSloop/AndroidNote/blob/master/CustomView/Advance/%5B7%5DPath_Over.md) 后, Path中各类方法基本上都讲完了,表格中还没有讲解到到方法就是矩阵变换了,难道本篇终于要讲矩阵了?
1212

1313
非也,矩阵这一部分仍在后面单独讲解,本篇主要讲解PathMeasure这个类与Path的一些使用技巧。
1414

1515
> PS:不要问我为什么不讲PathEffect,因为这个方法在后面的Paint系列中。
1616
1717
******
1818

19+
## PathMeasure
20+
21+
顾名思义,PathMeasure是一个用来测量Path的类,主要有以下方法:
22+
23+
### 构造方法
24+
25+
方法名 | 释义
26+
---|---
27+
PathMeasure() | 创建一个空的PathMeasure
28+
PathMeasure(Path path, boolean forceClosed) | 创建PathMeasure并关联一个指定的Path(Path需要已经创建完成)。
29+
30+
### 公共方法
31+
32+
返回值 | 方法名 | 释义
33+
--------|--------------------------------------------------------------------------|-------------------
34+
void | setPath(Path path, boolean forceClosed) | 关联一个Path
35+
boolean | isClosed() | 是否闭合
36+
float | getLength() | 获取Path的长度
37+
boolean | nextContour() | 跳转到下一个轮廓
38+
boolean | getSegment(float startD, float stopD, Path dst, boolean startWithMoveTo) | 截取片段
39+
boolean | getPosTan(float distance, float[] pos, float[] tan) | 获取指定长度的位置坐标及该点切线值
40+
boolean | getMatrix(float distance, Matrix matrix, int flags) | 获取指定长度的位置坐标及该点Matrix
41+
42+
43+
44+
1945

2046

2147

0 commit comments

Comments
 (0)