Creates a stroked copy of another path.
SDKs
- iOS 5.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Graphics
Declaration
CGPath Ref CGPathCreateCopyByStrokingPath(CGPath Ref path, const CGAffine Transform *transform, CGFloat lineWidth, CGLine Cap lineCap, CGLine Join 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—
k
(the default),CGLine Cap Butt k
, orCGLine Cap Round k
.CGLine Cap Square lineJoin
A line join value—
k
(the default),CGLine Join Miter k
, orCGLine Join Round k
.CGLine Join Bevel 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 k
, 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.