ios - 从 CGContextRef 获取 UIBezierPath 或 CGPath

标签 ios objective-c swift core-graphics uibezierpath

我在当前图形上下文中有一个贝塞尔路径,我想将其存储为 UIBezierPath 或 CGPath。你知道如何从 CGContextRef 中获取路径吗?

最佳答案

您可以使用 CGContextCopyPath 复制上下文的当前路径。

没有复制剪切路径的功能。实际上,如果您使用了 CGContextClipToMask,则剪辑区域不会由路径定义。

关于ios - 从 CGContextRef 获取 UIBezierPath 或 CGPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17245986/

相关文章:

ios - 如何防止 Firebase Cloud Messaging 在 iOS/Unity 上请求推送通知权限

ios - 从 Interface Builder 实例化的 View 中的僵尸对象

ios - 转换不适用于 IOS

iphone - 如何在模态视图中的工具栏上添加标题和完成按钮

swift - 实时绘图哪种方式更好?

ios - iOS 8 Today Extension 的最大高度?

ios - 返回 App 时 UIButton 动画停止?

ios - 在 SpriteKit 中保存一个关卡编号

ios - UINavigationController 包含、iOS7 和状态栏。漏洞?

ios - 使用 UpdateChildValues 从 Firebase 中删除