问题
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