---
title: "copy(strokingWithWidth:lineCap:lineJoin:miterLimit:transform:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgpath/copy(strokingwithwidth:linecap:linejoin:miterlimit:transform:)"
---

# copy(strokingWithWidth:lineCap:lineJoin:miterLimit:transform:)

Returns a new path equivalent to the results of drawing the path with a solid stroke.

## Declaration

```swift
func copy(strokingWithWidth lineWidth: CGFloat, lineCap: CGLineCap, lineJoin: CGLineJoin, miterLimit: CGFloat, transform: CGAffineTransform = .identity) -> CGPath
```

## Parameters

- `lineWidth`: The line width to use, in user space units. The value must be greater than 0.
- `lineCap`: The line cap style to render. (For equivalent doc://com.apple.coregraphics/documentation/CoreGraphics/CGContext drawing methods, the default style is doc://com.apple.coregraphics/documentation/CoreGraphics/CGLineCap/butt.)
- `lineJoin`: The line join style to render. (For equivalent doc://com.apple.coregraphics/documentation/CoreGraphics/CGContext drawing methods, the default style is doc://com.apple.coregraphics/documentation/CoreGraphics/CGLineJoin/miter.)
- `miterLimit`: A value that limits how sharp individual corners in the path can be when using the doc://com.apple.coregraphics/documentation/CoreGraphics/CGLineJoin/miter line join style. When the ratio of a the length required for a mitered corner to the line width exceeds this value, that corner uses the doc://com.apple.coregraphics/documentation/CoreGraphics/CGLineJoin/bevel style instead.
- `transform`: An affine transform to apply to the path before dashing. Defaults to the doc://com.apple.coregraphics/documentation/CoreGraphics/CGAffineTransformIdentity transform if not specified.

## Return Value

Return Value A new path.

## Discussion

Discussion The new path is created so that filling the new path draws the same pixels as stroking the original path with the specified line style.

## See Also

### Copying a Graphics Path

- [copy()](coregraphics/cgpath/copy().md)
- [copy(using:)](coregraphics/cgpath/copy(using:).md)
- [copy(dashingWithPhase:lengths:transform:)](coregraphics/cgpath/copy(dashingwithphase:lengths:transform:).md)
- [mutableCopy()](coregraphics/cgpath/mutablecopy().md)
- [mutableCopy(using:)](coregraphics/cgpath/mutablecopy(using:).md)
