screen-shot 0.0.8

Get a bitmap image of any display.
Documentation
# screen-shot-rs


[![Crates.io](https://img.shields.io/crates/v/screen-shot)](https://crates.io/crates/screen-shot)
[![Downloads](https://img.shields.io/crates/d/screen-shot)](https://crates.io/crates/screen-shot)
[![Docs.rs](https://img.shields.io/badge/docs.rs-latest-blue)](https://docs.rs/screen-shot)
[![License](https://img.shields.io/badge/license-CC0--1.0-lightgray)](LICENSE)
[![Issues](https://img.shields.io/github/issues/ssrlive/screen-shot-rs)](https://github.com/ssrlive/screen-shot-rs/issues)
[![Rust Edition](https://img.shields.io/badge/edition-2024-informational)](Cargo.toml)
[![Unsafe](https://img.shields.io/badge/unsafe-FFI%20+%20raw%20ptrs-red)](#-safety)
[![Maintenance](https://img.shields.io/badge/maintenance-active-brightgreen)](https://github.com/ssrlive/screen-shot-rs)

Get a bitmap image of any display in Rust. This crate is hosted on [crates.io](https://crates.io/crates/screen-shot).

> **Note:** This crate is a fork of [alexchandel/screenshot-rs]https://github.com/alexchandel/screenshot-rs.

Contributions welcome!

## Examples


```rust,no_run
use screen_shot::get_screenshot;

{
	let s = get_screenshot(0).unwrap();

	println!("{} x {}", s.width(), s.height());

	// ::image::save_buffer(&Path::new("test.png"),
	// 	s.as_slice(), s.width() as u32, s.height() as u32, image::RGBA(8))
	// .unwrap();
}
```

## Development

* screenshot-rs has its own systems bindings. It should migrate to [servo/rust-core-graphics]https://github.com/servo/rust-core-graphics and [retep998/winapi-rs]https://github.com/retep998/winapi-rs. I want to use [klutzy/rust-windows]https://github.com/klutzy/rust-windows, but it doesn't have the right bindings.

## Known Issues

* `get_screenshot` leaks memory on certain error conditions, by returning before releasing OS handles. PR's welcome.
* The BMP Image in the example is rotated +90 degrees because I don't adjust for BMP idiosyncrasy.
* The PNG Image in the example has its R & B channels exchanged because `PistonDevelopers/image` doesn't support ARGB pixels.