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

# captureImage(contentFilter:configuration:completionHandler:)

Captures a single frame from a stream as an image, using a filter.

## Declaration

```swift
class func captureImage(contentFilter: SCContentFilter, configuration config: SCStreamConfiguration, completionHandler: (@Sendable (CGImage?, (any Error)?) -> Void)? = nil)
```

```swift
class func captureImage(contentFilter: SCContentFilter, configuration config: SCStreamConfiguration) async throws -> CGImage
```

## Parameters

- `contentFilter`: The content filter used to select the stream.
- `config`: Configuration information for how to capture the screenshot.
- `completionHandler`: Closure that processes the screenshot taken from the streaming content.

## See Also

### Individual frame capture

- [captureSampleBuffer(contentFilter:configuration:completionHandler:)](screencapturekit/scscreenshotmanager/capturesamplebuffer(contentfilter:configuration:completionhandler:).md)
