Skip to main content

ScreenshotProvider

Trait ScreenshotProvider 

pub trait ScreenshotProvider: Send + Sync {
    // Required methods
    fn capture_full(&self) -> Result<Screenshot, Error>;
    fn capture_region(&self, rect: Rect) -> Result<Screenshot, Error>;
}
Expand description

Platform backend trait for screen capture.

Implementors snapshot pixels from a display or a sub-region. They must return physical (device) pixels — never downscaled to logical points — and report the scale factor alongside the pixel buffer.

§Errors

Required Methods§

fn capture_full(&self) -> Result<Screenshot, Error>

Capture the primary display in full.

fn capture_region(&self, rect: Rect) -> Result<Screenshot, Error>

Capture a sub-rectangle specified in logical screen coordinates (the same coordinate space as Rect in Element::bounds).

Implementations on Foreign Types§

§

impl ScreenshotProvider for LinuxScreenshot

Implementors§