Getting all points (not only control points) from UIBezierPath

∥☆過路亽.° 提交于 2019-12-24 11:35:35

问题


I have a UIBezierPath which i defined, and i can access the relevant points defined.

Now, i want to extract all the points in the line, not just the points i defined.

I saw these following questions:

Question 1

Question 2

And i was wondering if using the answers selected will give the result i want, meaning:

1) Extract all points (already have them) as suggested in question 1

2) Calculate all the points between each pair (or triplet) of points as suggested in question 2

Is this the right approach for this problem? is there any other solution?

Maybe stroke the line and than retrieve all the shown points somehow?

Cheers


回答1:


Just as crazy idea if it is not time critical code and you need to get points exactly: what if you draw this path into white image with black one pixel line and then just take all positions of black points from this image? It will give you exact coordinates for all points from this path.

It will be extremely slow but very precise.



来源:https://stackoverflow.com/questions/21431636/getting-all-points-not-only-control-points-from-uibezierpath

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!