pub struct ScreencopyView { /* private fields */ }Expand description
Shows what an output or a window shows, captured by the compositor,
in the box its style’s width and height give it, as an
Image shows a picture. It draws nothing until the
first frame arrives.
It captures one frame, unless it is live: then each change to the
source brings a new frame, and a source that doesn’t change sends
none, so it wakes nothing. A source that isn’t there yet, such as an
output not plugged in, is waited for. When it goes, the last frame
stays.
use crabshell_ui::{CaptureSource, ScreencopyView, Style};
let thumbnail = ScreencopyView::new(CaptureSource::Output(String::from("DP-1")))
.live(true)
.style(Style::new().width(192.0).height(108.0));Implementations§
Source§impl ScreencopyView
impl ScreencopyView
Sourcepub fn new(source: impl IntoProp<CaptureSource>) -> ScreencopyView
pub fn new(source: impl IntoProp<CaptureSource>) -> ScreencopyView
A view of source: a CaptureSource, or a closure that returns
one.
Sourcepub fn live(self, live: impl IntoProp<bool>) -> ScreencopyView
pub fn live(self, live: impl IntoProp<bool>) -> ScreencopyView
Whether each change to the source shows, rather than only the first frame. Off by default.
Sourcepub fn paint_cursors(self, paint: impl IntoProp<bool>) -> ScreencopyView
pub fn paint_cursors(self, paint: impl IntoProp<bool>) -> ScreencopyView
Whether the pointer is drawn into the frames. Off by default.
Sourcepub fn fit(self, fit: impl IntoProp<Fit>) -> ScreencopyView
pub fn fit(self, fit: impl IntoProp<Fit>) -> ScreencopyView
Sets how the frame fills the view’s box when their shapes differ.
Sourcepub fn style(self, style: impl IntoProp<Style>) -> ScreencopyView
pub fn style(self, style: impl IntoProp<Style>) -> ScreencopyView
Sets the style, whose width and height give the view its size.