From: Emil Sandin Date: 2007-03-12T21:51:22+09:00 Subject: Re: Print screen with win32api Daniele Alessandri wrote: > On 3/12/07, Emil Sandin wrote: > > mac. Since there is a "print screen"-button on the keyboard, I guess >> that it should be possible to use win32api to fake a klick on the >> keyboard button, and then somehow save the image to disk. > > > Try installing Win32::Screenshot ( > http://rubyforge.org/projects/win32screenshot/) and launching the > following > script: > > > require 'win32screenshot' > > width, height, bitmap = Win32::Screenshot.desktop > File.open('test.bmp', 'wb') { |file| file.write(bitmap) } > > > You can find more examples in the test folder after installing the gem > file. Wow, that sounds exactly right, Thank you! /Emil -- Posted via http://www.ruby-forum.com/.