I have a bezier path inside the current graphics context that I want to store as a UIBezierPath or CGPath. Do you know how to get the path out of a CGContextRef?
You can copy the context's current path using CGContextCopyPath
.
There is no function that copies the clipping path. Indeed, the clipping region won't be defined by a path if you've used CGContextClipToMask
.
您可以使用CGContextCopyPath
函数:
CGPathRef myPath = CGContextCopyPath(context);
You can just use for coping the path.
let copy = context.path
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.