---
title: "captureImage(in:completionHandler:)"
framework: screencapturekit
role: symbol
role_heading: Type Method
path: "screencapturekit/scscreenshotmanager/captureimage(in:completionhandler:)"
---

# captureImage(in:completionHandler:)

## Declaration

```swift
class func captureImage(in rect: CGRect, completionHandler: (@Sendable (CGImage?, (any Error)?) -> Void)? = nil)
```

```swift
class func captureImage(in rect: CGRect) async throws -> CGImage
```

## Parameters

- `rect`: The rect for the region in points on the screen space for the screen shot, this is display agnostic and supports multiple displays
- `completionHandler`: Is the handler that will deliver the screenshot to the client

## Discussion

Discussion captureImageInRect:completionHandler: this method returns an image containing the contents of the rectangle in points, specified in display space
