William Jockusch
William Jockusch

Reputation: 27295

iOS -- is there anything like CGContextSetLineDash for paths?

I want to draw a path, but with a dotted line rather than a solid one. Using lines would be possible, but it would be a pain.

Upvotes: 0

Views: 1068

Answers (1)

Anomie
Anomie

Reputation: 94794

The "line" in CGContextSetLineCap, CGContextSetLineDash, CGContextSetLineJoin, and CGContextSetLineWidth refers to the "line" of color that is drawn along the path when stroking it, as opposed to the solid area inside that is colored when filling. This is not to be confused with the "line" in CGContextAddLines, CGContextAddLineToPoint, CGPathAddLines, and CGPathAddLineToPoint, which refers to the geometrical line segment that may be part of a path.

To use an analogy, when you're drawing by hand on paper you move your pen along a path which leaves a line on the paper.

Upvotes: 1

Related Questions