---
title: "draw(in:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsimage/draw(in:)"
---

# draw(in:)

Draws the image in the specified rectangle.

## Declaration

```swift
func draw(in rect: NSRect)
```

## Parameters

- `rect`: The rectangle in which to draw the image, specified in the current coordinate system.

## Discussion

Discussion This method draws the entire image in the specified rectangle, scaling the image as needed. The method composites the image using the NSCompositeSourceOver operation

## See Also

### Drawing Images

- [draw(at:from:operation:fraction:)](appkit/nsimage/draw(at:from:operation:fraction:).md)
- [draw(in:from:operation:fraction:)](appkit/nsimage/draw(in:from:operation:fraction:).md)
- [draw(in:from:operation:fraction:respectFlipped:hints:)](appkit/nsimage/draw(in:from:operation:fraction:respectflipped:hints:).md)
- [drawRepresentation(_:in:)](appkit/nsimage/drawrepresentation(_:in:).md)
- [NSCompositingOperation](appkit/nscompositingoperation.md)
