---
title: "captureScreenshot(rect:configuration:completionHandler:)"
framework: screencapturekit
role: symbol
role_heading: Type Method
path: "screencapturekit/scscreenshotmanager/capturescreenshot(rect:configuration:completionhandler:)"
---

# captureScreenshot(rect:configuration:completionHandler:)

## Declaration

```swift
class func captureScreenshot(rect: CGRect, configuration config: SCScreenshotConfiguration, completionHandler: (@Sendable (SCScreenshotOutput?, (any Error)?) -> Void)? = nil)
```

```swift
class func captureScreenshot(rect: CGRect, configuration config: SCScreenshotConfiguration) async throws -> SCScreenshotOutput
```

## 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
- `config`: Is the screenshot configuration containing information on how to format the screenshot
- `completionHandler`: Is the handler that will deliver the SCScreenshotOutput object to the client

## Discussion

Discussion captureScreenshotWithRect:configuration:completionHandler: this method returns an SCScreenshotOutput object containing CGImages of the screenshot requested by the client
