pub struct Monitor { /* private fields */ }
Expand description
Monitor context for screen duplication. This is stateless and immutable.
To create a new instance, use Scanner
.
Implementations§
Source§impl Monitor
impl Monitor
Sourcepub fn monitor_info(&self) -> Result<MONITORINFO>
pub fn monitor_info(&self) -> Result<MONITORINFO>
This is usually used to check if the monitor is primary.
§Examples
use rusty_duplication::{Scanner, MonitorInfoExt};
let monitor = Scanner::new().unwrap().next().unwrap();
monitor.monitor_info().unwrap().is_primary();
Sourcepub fn dxgi_output_desc(&self) -> Result<DXGI_OUTPUT_DESC>
pub fn dxgi_output_desc(&self) -> Result<DXGI_OUTPUT_DESC>
This is usually used to get the screen’s position and size.
§Examples
use rusty_duplication::{Scanner, OutputDescExt};
let monitor = Scanner::new().unwrap().next().unwrap();
let desc = monitor.dxgi_output_desc().unwrap();
println!("{}x{}", desc.width(), desc.height());
Sourcepub fn dxgi_outdupl_desc(&self) -> DXGI_OUTDUPL_DESC
pub fn dxgi_outdupl_desc(&self) -> DXGI_OUTDUPL_DESC
This is usually used to get the screen’s pixel width/height and buffer size.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Monitor
impl RefUnwindSafe for Monitor
impl Send for Monitor
impl Sync for Monitor
impl Unpin for Monitor
impl UnwindSafe for Monitor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more