Struct x11_screenshot::Screen[][src]

pub struct Screen { /* fields omitted */ }

A handle to an X11 screen.

Implementations

impl Screen[src]

pub fn open() -> Option<Screen>[src]

Tries to open the X11 display, then returns a handle to the default screen.

Returns None if the display could not be opened.

pub fn capture(&self) -> Option<RgbImage>[src]

Tries to capture a screenshot of the entire screen.

Returns an RgbImage on success, None on failure.

See the documentation of the image crate on how to use RgbImage.

pub fn capture_area(&self, w: u32, h: u32, x: i32, y: i32) -> Option<RgbImage>[src]

Tries to capture a screenshot of the provided area.

Returns an RgbImage on success, None on failure.

See the documentation of the image crate on how to use RgbImage.

Trait Implementations

impl Drop for Screen[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.