qshot

Crates.ioqshot
lib.rsqshot
version0.1.3
sourcesrc
created_at2023-01-19 20:54:16.541926
updated_at2023-09-08 18:42:55.024348
descriptionA simple screenshotting library for Windows that focuses on performance.
homepage
repositoryhttps://github.com/V9X/qshot-rs
max_upload_size
id762925
size9,938
(V9X)

documentation

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

use std::error::Error;
use qshot::CaptureManager;

fn main() -> Result<(), Box<dyn Error>> {
	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.

Commit count: 8

cargo fmt