Class: Cosmos::Screenshot

Inherits:
Object show all
Defined in:
lib/cosmos/gui/utilities/screenshot.rb

Overview

Class to take screenshots of COSMOS windows

Class Method Summary collapse

Class Method Details

.screenshot_window(window, filename) ⇒ Object

Take a screenshot of the given window



17
18
19
20
21
22
# File 'lib/cosmos/gui/utilities/screenshot.rb', line 17

def self.screenshot_window (window, filename)
  # Create a Pixmap to save the screenshot into
  pixmap = Qt::Pixmap::grabWindow(window.winId())
  pixmap.save(filename)
  pixmap
end