lib/screen-recorder/screenshot.rb
#
# Takes a screenshot in the current context (input) - desktop or current window
#
Takes a screenshot in the current context (input) - desktop or current window
Takes a screenshot in the current context ( input ) - desktop or current window
def screenshot(filename, resolution = nil)
      ScreenRecorder.logger.debug "Screenshot filename: #{filename}, resolution: #{resolution}"
      cmd = screenshot_cmd(filename: filename, resolution: resolution)
      process = execute_command(cmd)
      exit_code = wait_for_process_exit(process) 
      if exit_code&.zero?
        ScreenRecorder.logger.info "Screenshot: #{filename}"
        return filename
      end
      ScreenRecorder.logger.error 'Failed to take a screenshot.'
      nil
    end
def screenshot ( filename , resolution = nil ) ScreenRecorder . logger . debug "Screenshot filename: #{filename}, resolution: #{resolution}" cmd = screenshot_cmd ( filename : filename , resolution : resolution ) process = execute_command ( cmd ) exit_code = wait_for_process_exit ( process ) if exit_code &. zero? ScreenRecorder . logger . info "Screenshot: #{filename}" return filename end ScreenRecorder . logger . error 'Failed to take a screenshot.' nil end
Takes a screenshot in the current context (input) - desktop or current window
Takes a screenshot in the current context ( input ) - desktop or current window
# 0 (success) or 1 (fail)
filename
<not_specific>
resolution
<not_specific>