Module screenshot_manager

Module screenshot_manager 

Source
Expand description

SCScreenshotManager - Single-shot screenshot capture

Available on macOS 14.0+. Provides high-quality screenshot capture without the overhead of setting up a stream.

§When to Use

Use SCScreenshotManager when you need:

  • A single screenshot rather than continuous capture
  • Quick capture without stream setup/teardown overhead
  • Direct saving to image files

For continuous capture, use SCStream instead.

§Example

use screencapturekit::screenshot_manager::{SCScreenshotManager, ImageFormat};
use screencapturekit::stream::{content_filter::SCContentFilter, configuration::SCStreamConfiguration};
use screencapturekit::shareable_content::SCShareableContent;

let content = SCShareableContent::get()?;
let display = &content.displays()[0];
let filter = SCContentFilter::create().with_display(display).with_excluding_windows(&[]).build();
let config = SCStreamConfiguration::new()
    .with_width(1920)
    .with_height(1080);

// Capture as CGImage
let image = SCScreenshotManager::capture_image(&filter, &config)?;
println!("Screenshot: {}x{}", image.width(), image.height());

// Save to file
image.save_png("/tmp/screenshot.png")?;

// Or save as JPEG with quality
image.save("/tmp/screenshot.jpg", ImageFormat::Jpeg(0.85))?;

Structs§

CGImage
CGImage wrapper for screenshots
SCScreenshotConfiguration
Configuration for advanced screenshot capture (macOS 26.0+)
SCScreenshotManager
Manager for capturing single screenshots
SCScreenshotOutput
Output from advanced screenshot capture (macOS 26.0+)

Enums§

ImageFormat
Image output format for saving screenshots
SCScreenshotDisplayIntent
Display intent for screenshot rendering (macOS 26.0+)
SCScreenshotDynamicRange
Dynamic range for screenshot output (macOS 26.0+)