有没有办法让 CGPath 增长 x 像素?

发布于 2024-08-30 05:51:36 字数 109 浏览 3 评论 0原文

我正在构建一个自定义 UIView,它在 drawRect: 方法中绘制自己的内容。我想用一种颜色描边 CGPath,然后将此选区增大 1px 并用另一种颜色描边。有人找到了一种很容易做到这一点的方法吗?

I'm building a custom UIView, which draws its own content in a drawRect: Method. I want to stroke a CGPath with a color, and then grow this selection 1px and stroke with another color. Has somebody worked out a method to do this quite easily?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

零時差 2024-09-06 05:51:36

您可以尝试对图形上下文应用适当的缩放变换。

You could try applying an appropriate scaling transformation to your graphics context.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文