石英 2D 笔画对齐
使用 kCGPathFillStroke 作为绘图模式时,是否可以调整笔画的默认居中对齐方式?
例如,当使用以下方法绘制闭合路径时:
CGContextDrawPath(context, kCGPathFillStroke);
笔划位于绘制路径外部 50%/内部 50%。描边颜色具有不透明的 Alpha,因此最终效果并不理想。我希望中风位于内侧或外侧。
我认为执行此操作的唯一可能方法是重建路径,收缩 50% 的笔画宽度。
Is it possible to adjust the alignment, from the default centered, of a stroke when using kCGPathFillStroke as the drawing mode?
For example, when drawing a closed path using:
CGContextDrawPath(context, kCGPathFillStroke);
The stroke lies 50% outside/50% inside the drawn path. The stroke color has a non-opaque alpha so the net effect is undesirable. I want the stroke to lie either all inside or outside.
The only potential way I see of doing this is to rebuild the path, contracted by 50% of the stroke width.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的猜测是正确的。调整路径的位置。
Your guess is correct. Adjust the path's position.