Get UIBezierPath Stroke's Outline Path

百般思念 提交于 2019-12-20 02:26:12

问题


I have a UIBezierPath stroke, now I want to get the stroke's outline path(not the stroke's path itself), is there a way I could get that? or at least NSLog the UIBezierPath stroke's outline path? Thanks


回答1:


You can use CGPathCreateCopyByStrokingPath for this.

UIBezierPath *path = ...;
CGFloat lineWidth = 10;
CGPathRef cgStrokedPath = CGPathCreateCopyByStrokingPath(path.CGPath, NULL,
    lineWidth, kCGLineCapRound, kCGLineJoinRound, 0);
UIBezierPath *strokedPath = [UIBezierPath bezierPathWithCGPath:cgStrokedPath];


来源:https://stackoverflow.com/questions/42572434/get-uibezierpath-strokes-outline-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!