【问题标题】:iOS -- is there anything like CGContextSetLineDash for paths?iOS - 有没有类似 CGContextSetLineDash 的路径?
【发布时间】:2011-07-27 20:29:41
【问题描述】:

我想画一条路径,但用虚线而不是实线。使用线条是可能的,但会很痛苦。

【问题讨论】:

    标签: iphone objective-c ios drawing cgcontext


    【解决方案1】:

    CGContextSetLineCap、CGContextSetLineDash、CGContextSetLineJoin 和 CGContextSetLineWidth 中的“线”是指在描边时沿路径绘制的颜色“线”,而不是在填充时着色的内部实心区域。请勿与 CGContextAddLines、CGContextAddLineToPoint、CGPathAddLines 和 CGPathAddLineToPoint 中的“线”混淆,后者指的是可能是路径一部分的几何线段。

    打个比方,当您在纸上手绘时,您将笔沿路径移动,从而在纸上留下线条

    【讨论】:

    • 即CGContextSetLineDash is 用于路径
    猜你喜欢
    • 1970-01-01
    • 2022-01-04
    • 1970-01-01
    • 2013-07-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多