how to make screenshot

Asked on 04/06/2025

1 search

To take a screenshot using the new APIs presented at WWDC, you can use the SC screenshot manager from the ScreenCaptureKit. This manager offers a screenshot API that allows you to take screenshots in HDR. Here's a brief overview of how you can achieve this:

  1. Create a Configuration: Start by creating a configuration for HDR local display. This configuration will be pre-populated with recommended values for taking HDR screenshots.

  2. Choose the Output Format: If your app needs CM sample buffers for the screenshot, use the captureSampleBuffer function. If a CG image is preferred, use the captureImage function.

  3. Use Presets: Presets are available for taking HDR screenshots, and you can choose between local or canonical display presets depending on your needs.

For more detailed information, you can refer to the session Capture HDR content with ScreenCaptureKit (05:51) where they discuss the screenshot API and provide code examples.