#graphics #image #gui #scripting

nightly screenshot

Get a bitmap image of any display

7 releases

Uses old Rust 2015

0.0.7 Oct 9, 2015
0.0.6 May 14, 2015
0.0.5 Jan 20, 2015

#186 in Graphics APIs

49 downloads per month

CC0 license

644 lines


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

Contributions welcome!


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

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

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

		s.as_slice(), s.width() as u32, s.height() as u32, image::RGBA(8))


Known Issues

  • Can leak memory on certain failure conditions.
  • 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.