Class: Win32::Screenshot::Take
- Inherits:
-
Object
- Object
- Win32::Screenshot::Take
- Defined in:
- lib/win32/screenshot/take.rb
Overview
Capture Screenshots on Windows with Ruby
Class Method Summary collapse
-
.of(what, opts = {}) ⇒ Image
(also: new)
Takes a screenshot of the specified object or it’s area.
Class Method Details
.of(what, opts = {}) ⇒ Image Also known as: new
Takes a screenshot of the specified object or it’s area.
45 46 47 48 49 50 |
# File 'lib/win32/screenshot/take.rb', line 45 def of(what, opts = {}) valid_whats = [:foreground, :desktop, :window] raise "It is not possible to take a screenshot of '#{what}', possible values are #{valid_whats.join(", ")}" unless valid_whats.include?(what) self.send(what, {:context => :window}.merge(opts)) end |