<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGPath/copy(strokingWithWidth:lineCap:lineJoin:miterLimit:transform:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "s:So9CGPathRefa12CoreGraphicsE4copy17strokingWithWidth7lineCap0I4Join10miterLimit9transformAB0C10Foundation7CGFloatV_So06CGLineJ0VSo0qK0VALSo17CGAffineTransformVtF"
  },
  "title" : "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.

```
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 [`CGContext`](/documentation/CoreGraphics/CGContext) drawing methods, the default style is [`CGLineCap.butt`](/documentation/CoreGraphics/CGLineCap/butt).)

`lineJoin`

The line join style to render. (For equivalent [`CGContext`](/documentation/CoreGraphics/CGContext) drawing methods, the default style is [`CGLineJoin.miter`](/documentation/CoreGraphics/CGLineJoin/miter).)

`miterLimit`

A value that limits how sharp individual corners in the path can be when using the [`CGLineJoin.miter`](/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 [`CGLineJoin.bevel`](/documentation/CoreGraphics/CGLineJoin/bevel) style instead.

`transform`

An affine transform to apply to the path before dashing. Defaults to the [`CGAffineTransformIdentity`](/documentation/CoreGraphics/CGAffineTransformIdentity) transform if not specified.

## Return Value

A new path.

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)