Crates.io | screenshot_desktop |
lib.rs | screenshot_desktop |
version | 0.1.0 |
source | src |
created_at | 2024-08-07 02:24:11.775662 |
updated_at | 2024-08-07 02:24:11.775662 |
description | Take a screenshot of a screen |
homepage | |
repository | https://github.com/GuoJikun/screenshot |
max_upload_size | |
id | 1328000 |
size | 35,209 |
Take a screenshot of a screen;
First, add screenshot to your project by cargo.
use std::path::Path;
use screenshot_desktop::Screenshot;
fn main(){
let _ = match Screenshot::new() {
Ok(screenshot) => {
screenshot.save(&Path::new("screenshot.png")).map_err(|e| e.to_string())
},
Err(_) => {
Err("Failed to capture screenshot".to_string())
},
};
}
Platform/平台 | status/状态 |
---|---|
Windows | Done |
Linux | Come Soon |
Macos | Come Soon |
MIT + Apache-2.0