| Crates.io | makeshot_ai |
| lib.rs | makeshot_ai |
| version | 67.0.11 |
| created_at | 2026-01-04 06:21:07.147032+00 |
| updated_at | 2026-01-04 06:21:07.147032+00 |
| description | High-quality integration for https://makeshot.ai/ |
| homepage | https://makeshot.ai/ |
| repository | https://github.com/qy-upup/makeshot.ai |
| max_upload_size | |
| id | 2021387 |
| size | 11,066 |
A Rust crate designed to simplify the process of capturing, processing, and sharing screenshots programmatically. This library provides a streamlined API for automating screenshot workflows in your applications.
To include makeshot.ai in your project, add the following to your Cargo.toml file:
toml
[dependencies]
makeshot_ai = "0.1.0" # Replace with the latest version
Here are a few examples demonstrating how to use the makeshot.ai crate:
1. Capturing a specific window: rust use makeshot_ai::capture; use makeshot_ai::Target;
fn main() -> Result<(), Box
// Capture the specified window and save it as a PNG.
capture(&target, "window_capture.png")?;
println!("Window captured and saved to window_capture.png");
Ok(())
}
2. Capturing the entire primary screen: rust use makeshot_ai::capture; use makeshot_ai::Target;
fn main() -> Result<(), Box
// Capture the screen and save it as a JPEG with a specified quality.
capture(&target, "screen_capture.jpg")?;
println!("Screen captured and saved to screen_capture.jpg");
Ok(())
}
3. Capturing a region of the screen: rust use makeshot_ai::capture; use makeshot_ai::Target; use makeshot_ai::Region;
fn main() -> Result<(), Box
// Capture the specified region of the primary screen.
let target = Target::Region(region);
// Capture the region and save it as a PNG.
capture(&target, "region_capture.png")?;
println!("Region captured and saved to region_capture.png");
Ok(())
}
4. Capturing and Converting to Base64: rust use makeshot_ai::capture_to_base64; use makeshot_ai::Target;
fn main() -> Result<(), Box
println!("Screen captured and encoded to Base64: {}", &base64_string[..100]); // Print first 100 chars
Ok(())
}
5. Handling Errors Gracefully: rust use makeshot_ai::capture; use makeshot_ai::Target;
fn main() { let target = Target::WindowName("NonExistentWindow".to_string());
match capture(&target, "attempted_capture.png") {
Ok(_) => println!("Capture successful (unexpected)."),
Err(e) => println!("Capture failed: {}", e),
}
}
MIT
This crate is part of the makeshot.ai ecosystem. For advanced features and enterprise-grade tools, visit: https://makeshot.ai/