---
title: "draw(_:in:style:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/graphicscontext/draw(_:in:style:)"
---

# draw(_:in:style:)

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

## Declaration

```swift
func draw(_ image: GraphicsContext.ResolvedImage, in rect: CGRect, style: FillStyle = FillStyle())
```

## Parameters

- `image`: The doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext/ResolvedImage to draw. Get a resolved image from an doc://com.apple.SwiftUI/documentation/SwiftUI/Image by calling doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext/resolve(_:)-898z6. Alternatively, you can call doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext/draw(_:in:style:)-blhz with an doc://com.apple.SwiftUI/documentation/SwiftUI/Image, and that method performs the resolution automatically.
- `rect`: The rectangle in the current user space to draw the image in.
- `style`: A fill style to use when rasterizing the image.

## Discussion

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

## See Also

### Drawing images, text, and views

- [draw(_:in:)](swiftui/graphicscontext/draw(_:in:).md)
- [draw(_:at:anchor:)](swiftui/graphicscontext/draw(_:at:anchor:).md)
