use Screencapturekit to capture a specific window

Generated on 3/3/2025

1 search

To capture a specific window using ScreenCaptureKit, you can utilize the SCStream object, which allows you to receive screen and audio samples in your app. You can specify what to capture by providing an SCContentFilter to the stream. This filter can be configured to capture an entire screen or just specific windows and apps.

For more detailed guidance on using ScreenCaptureKit, you can refer to the session titled "Capture HDR content with ScreenCaptureKit" from WWDC 2024. This session covers the basics of capturing screen and audio, as well as advanced features like capturing HDR content and adding microphone output.

If you are interested in capturing HDR content specifically, you can start by configuring your stream with the appropriate properties on the SCStreamConfiguration, such as setting the dynamic range and pixel format. For capturing a specific window, you would adjust the SCContentFilter accordingly.

For more information, you can watch the session Capture HDR content with ScreenCaptureKit (01:20) which covers capturing HDR content.

Discover area mode for Object Capture

Discover area mode for Object Capture

Discover how area mode for Object Capture enables new 3D capture possibilities on iOS by extending the functionality of Object Capture to support capture and reconstruction of an area. Learn how to optimize the quality of iOS captures using the new macOS sample app for reconstruction, and find out how to view the final results with Quick Look on Apple Vision Pro, iPhone, iPad or Mac. Learn about improvements to 3D reconstruction, including a new API that allows you to create your own custom image processing pipelines.

Work with windows in SwiftUI

Work with windows in SwiftUI

Learn how to create great single and multi-window apps in visionOS, macOS, and iPadOS. Discover tools that let you programmatically open and close windows, adjust position and size, and even replace one window with another. We’ll also explore design principles for windows that help people use your app within their workflows.

What’s new in AppKit

What’s new in AppKit

Discover the latest advances in Mac app development. Get an overview of the new features in macOS Sequoia, and how to adopt them in your app. Explore new ways to integrate your existing code with SwiftUI. Learn about the improvements made to numerous AppKit controls, like toolbars, menus, text input, and more.

Tailor macOS windows with SwiftUI

Tailor macOS windows with SwiftUI

Make your windows feel tailor-made for macOS. Fine-tune your app’s windows for focused purposes, ease of use, and to express functionality. Use SwiftUI to style window toolbars and backgrounds. Arrange your windows with precision, and make smart decisions about restoration and minimization.

Introducing enterprise APIs for visionOS

Introducing enterprise APIs for visionOS

Find out how you can use new enterprise APIs for visionOS to create spatial experiences that enhance employee and customer productivity on Apple Vision Pro.

Capture HDR content with ScreenCaptureKit

Capture HDR content with ScreenCaptureKit

Learn how to capture high dynamic colors using ScreenCaptureKit, and explore new features like HDR support, microphone capture, and straight-to-file recording.

What’s new in SwiftUI

What’s new in SwiftUI

Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.

Build a great Lock Screen camera capture experience

Build a great Lock Screen camera capture experience

Find out how the LockedCameraCapture API can help you bring your capture application’s most useful information directly to the Lock Screen. Examine the API’s features and functionality, learn how to get started creating a capture extension, and find out how that extension behaves when the device is locked.