UIBezierPath from image

放肆的年华 提交于 2019-12-20 09:25:06

问题


I have several png files that look similar to this this:

Everything is transparent but the black path. What I am trying to do is create a UIBezierPath from the non transparent part.

Edit: So I was thinking what about creating a mask with the png then from the mask go to a UIBezierPath. Would that work?

Edit Again: I found the solution, look at my answer.


回答1:


I went a different direction. Instead of using PNGs I went with SVG and used PocketSVG to parse the file. It works great.




回答2:


The process you're looking for is known as skeletonization, there's a good summary of techniques in this post: Determine the midline of a bent, elongated region



来源:https://stackoverflow.com/questions/15252237/uibezierpath-from-image

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