Function

CGPathCreateCopyByStrokingPath

Creates a stroked copy of another path.

Declaration

CGPathRef CGPathCreateCopyByStrokingPath(CGPathRef path, const CGAffineTransform *transform, CGFloat lineWidth, CGLineCap lineCap, CGLineJoin lineJoin, CGFloat miterLimit);

Parameters

path

The path to copy.

transform

A pointer to an affine transformation matrix, or NULL if no transformation is needed. If specified, Core Graphics applies the transformation to elements of the converted path before adding them to the new path.

lineWidth

The line width to use, in user space units. The value must be greater than 0.

lineCap

A line cap style constant—kCGLineCapButt (the default), kCGLineCapRound, or kCGLineCapSquare.

lineJoin

A line join value—kCGLineJoinMiter (the default), kCGLineJoinRound, or kCGLineJoinBevel.

miterLimit

The miter limit to use.

Return Value

A new, immutable path. You are responsible for releasing this object.

Discussion

The new path is created so that filling the new path draws the same pixels as stroking the original path.

If the line join style is set to kCGLineJoinMiter, Core Graphics uses the miter limit to determine whether the lines should be joined with a bevel instead of a miter. Core Graphics divides the length of the miter by the line width. If the result is greater than the miter limit, Core Graphics converts the style to a bevel.

See Also

Creating and Managing Paths

CGPathCreateMutable

Creates a mutable graphics path.

CGPathCreateWithEllipseInRect

Create an immutable path of an ellipse.

CGPathCreateWithRect

Create an immutable path of a rectangle.

CGPathCreateWithRoundedRect

Create an immutable path of a rounded rectangle.

CGPathCreateCopy

Creates an immutable copy of a graphics path.

CGPathCreateCopyByTransformingPath

Creates an immutable copy of a graphics path transformed by a transformation matrix.

CGPathCreateCopyByDashingPath

Creates a dashed copy of another path.

CGPathCreateMutableCopy

Creates a mutable copy of an existing graphics path.

CGPathCreateMutableCopyByTransformingPath

Creates a mutable copy of a graphics path transformed by a transformation matrix.

CGPathRelease

Decrements the retain count of a graphics path.

CGPathRetain

Increments the retain count of a graphics path.