[LRUG] print a windows screenshot in Ruby and append it to a file?

Murray Steele murray.steele at gmail.com
Wed Feb 27 09:56:39 PST 2008


On 27/02/2008, aidy lewis <aidy.lewis at googlemail.com> wrote:
>
> Does anyone know how to print a windows screenshot in Ruby and append it
> to a file?
>
Not really sure what you want exactly, but I suspect that something like the
win32ole library might give you access to the windows clipboard etc...  Then
it's just a case of working out how to force a print screen via win32ole
calls and then get at the contents of the clipboard as an array of bytes.
You can then use standard ruby stuff to shoot those bytes into a file.  That
said, there might even be a win32ole call to put contents of clipboard
straight into a file.

MSDN is probably your best bet.

Apologies if I'm completely on the wrong track here.

Muz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20080227/122a7562/attachment.html>


More information about the Chat mailing list