Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 UIBezierPath 实现了一个自由手绘模块,但我想在完成绘制后获得曲线的所有帧,我该怎么做。
如果有办法获得连接路径的路径点,那就太好了。
您的问题并不完全清楚,但是如果您想要 a 的边界矩形UIBezierPath,则有一个bounds属性。
UIBezierPath
bounds
如果您想知道连接另一条路径的最后一个点的位置,则有该currentPoint属性。
currentPoint
如果你想检查路径的不同部分,你必须深入到底层CGPath和CGPathApply函数。
CGPath
CGPathApply
如果你想测试一个点是否在路径内(将被填充),你可以使用该containsPoint:方法,如果你想测试一个点是否是路径的一部分,你必须自己使用 Bézier 进行数学运算公式...
containsPoint: