screenshot 0.0.5

Get a bitmap image of any display.
docs.rs failed to build screenshot-0.0.5
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

screenshot-rs

Get a bitmap image of any display in Rust. This crate is hosted on crates.io.

Contributions welcome!

Examples

extern crate image;
extern crate screenshot;
use screenshot::get_screenshot;

fn main() {
	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. I want to depend on servo/rust-core-graphics and klutzy/rust-windows, but neither supports Cargo.
  • There is no Linux support.
  • Screenshot should provide a container_as_bytes() or an as_slice() method, rather than requiring unsafe access to its Vec buffer.

Known Issues

  • 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.