Cannot capture image in second screen
ctkai01 opened this issue · comments
ctkai01 commented
I run this code and being panic in Ubuntu 20.04 Wayland: called Result::unwrap() on an Err value: IoError(Custom { kind: Other, error: "Zero width not allowed" })
. Here is my code:
`
use screenshots::Screen;
fn main() {
let screens = Screen::all().unwrap();
for screen in screens {
println!("Capturing {screen:?}");
let image = screen.capture_area(screen.display_info.x, screen.display_info.y, screen.display_info.width, screen.display_info.height).unwrap();
image.save(format!("images/{}.png", screen.display_info.id)).unwrap();
}
}`