Function

CGContextStrokeLineSegments

Strokes a sequence of line segments.

Declaration

void CGContextStrokeLineSegments(CGContextRef c, const CGPoint *points, size_t count);

Parameters

c

A graphics context.

points

An array of points, organized as pairs—the starting point of a line segment followed by the ending point of a line segment. For example, the first point in the array specifies the starting position of the first line, the second point specifies the ending position of the first line, the third point specifies the starting position of the second line, and so forth.

count

The number of points in the points array.

Discussion

This function creates a new path, adds the individual line segments to the path, and then strokes the path. The current path is cleared as a side effect of calling this function.

See Also

Painting Paths

CGContextClearRect

Paints a transparent rectangle.

CGContextDrawPath

Draws the current path using the provided drawing mode.

CGContextEOFillPath

Paints the area within the current path, using the even-odd fill rule.

CGContextFillPath

Paints the area within the current path, using the nonzero winding number rule.

CGContextFillRect

Paints the area contained within the provided rectangle, using the fill color in the current graphics state.

CGContextFillRects

Paints the areas contained within the provided rectangles, using the fill color in the current graphics state.

CGContextFillEllipseInRect

Paints the area of the ellipse that fits inside the provided rectangle, using the fill color in the current graphics state.

CGContextStrokePath

Paints a line along the current path.

CGContextStrokeRect

Paints a rectangular path.

CGContextStrokeRectWithWidth

Paints a rectangular path, using the specified line width.

CGContextReplacePathWithStrokedPath

Replaces the path in the graphics context with the stroked version of the path.

CGContextStrokeEllipseInRect

Strokes an ellipse that fits inside the specified rectangle.