来自图像的UIBezierPath [英] UIBezierPath from image
本文介绍了来自图像的UIBezierPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有几个与此类似的png文件:
I have several png files that look similar to this this:
一切都是透明的,但是黑色的路径。我想要做的是从非透明部分创建一个UIBezierPath。
Everything is transparent but the black path. What I am trying to do is create a UIBezierPath from the non transparent part.
编辑:
所以我在考虑使用png创建一个掩码然后从掩码转到UIBezierPath。这会有用吗?
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.
推荐答案
我走向了另一个方向。我没有使用PNG,而是使用SVG并使用 PocketSVG 来解析文件。效果很好。
I went a different direction. Instead of using PNGs I went with SVG and used PocketSVG to parse the file. It works great.
这篇关于来自图像的UIBezierPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文