<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/GraphicsContext/draw(_:in:style:)-blhz",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15GraphicsContextV4draw_2in5styleyAA5ImageV_So6CGRectVAA9FillStyleVtF"
  },
  "title" : "draw(_:in:style:)"
}
-->

# draw(_:in:style:)

Draws an image into the context, using the specified rectangle
as a layout frame.

```
func draw(_ image: Image, in rect: CGRect, style: FillStyle = FillStyle())
```

## Parameters

`image`

The `Image` to draw. Before drawing, the method converts
the image to a `ResolvedImage` by calling `resolve(_:)-898z6`.

`rect`

The rectangle in the current user space to draw the image in.

`style`

A fill style to use when rasterizing the image.

## Discussion

The current context state defines the full drawing operation. For
example, the current transformation and clip shapes affect how SwiftUI
draws the image.

---

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)