如何绘制可变宽度的UIBezierPath? [英] How to draw variable-width UIBezierPath?

查看:147
本文介绍了如何绘制可变宽度的UIBezierPath?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何绘制一个笔划宽度在圆弧中心达到峰值的uibezier路径。这里是我的意思的一个例子:





绘图时我必须经过每个点,并相应地设置笔触宽度,或者有一种更简单的方法。任何人都可以将我指向正确的方向吗?



谢谢 你可以绘制两个没有笔画的外部路径,加入它们,然后填充它们之间的空间。


I'm wondering how I should go about drawing a uibezierpath where the stroke width peaks at the center of the arc. Here's an example of what I mean:

Either I have to go through each point when drawing, and set the stroke width accordingly, or there's an easier way. Can anyone point me in the right direction?

Thanks

解决方案

You can just draw the two outer paths with no stroke, join them, and then fill in the space between them.

这篇关于如何绘制可变宽度的UIBezierPath?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆