https://github.com/v9x/qshot-rs
A Rust crate for capturing a custom area of the screen/window, designed using raw Windows API calls to achieve top performance.
https://github.com/v9x/qshot-rs
crate rust screen-capture screenshot screenshots windows
Last synced: 3 months ago
JSON representation
A Rust crate for capturing a custom area of the screen/window, designed using raw Windows API calls to achieve top performance.
- Host: GitHub
- URL: https://github.com/v9x/qshot-rs
- Owner: V9X
- License: mit
- Created: 2023-01-19T20:45:11.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-08T18:39:24.000Z (almost 3 years ago)
- Last Synced: 2026-01-02T11:59:55.389Z (6 months ago)
- Topics: crate, rust, screen-capture, screenshot, screenshots, windows
- Language: Rust
- Homepage:
- Size: 7.81 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Qshot
Qshot is a high performance crate that allows you to take screenshots quickly and easily on Windows.
## What exactly is this library?
It's just a thin wrapper around a bunch of winapi functions to make screenshotting of a particular area as fast and easy as possible, while keeping memory safe.
It does not make any assumptions on what you may want to do with the data, you get a raw slice containing bitmap bit values and that's it.
## Example usage
```rust
use std::error::Error;
use qshot::CaptureManager;
fn main() -> Result<(), Box> {
let manager = CaptureManager::new(0, (250, 250), (500, 500))?;
for i in 0..1000 {
if i == 500 {
manager.change_size((100, 100), (100, 250));
}
let res = manager.capture()?;
do_something(res.get_bits());
}
Ok(())
}
```
## Contribution
Feel free to open a pull request if you think that something could have been done better or more efficiently or at least open an issue so I can look into that.