Ejemplo n.º 1
0
    def take_screenshot(self):
        """Take a screenshot"""
        log.info("Clearing window")
        self.signal_update_screenshot_pic.emit(Image.new('RGB', (3, 3)))

        log.info("Taking screenshot")
        config = ConfigObj(CONFIG_FILENAME)
        control = config['control']
        if control == 'Direct mouse control':
            self.original_screenshot = take_screenshot()

        else:
            try:
                vb = VirtualBoxController()
                self.original_screenshot = vb.get_screenshot_vbox()
                log.debug("Screenshot taken from virtual machine")
            except:
                log.warning(
                    "No virtual machine found. Press SETUP to re initialize the VM controller"
                )
                self.original_screenshot = take_screenshot()

        log.info("Emitting update signal")
        self.signal_update_screenshot_pic.emit(self.original_screenshot)
        log.info("signal emission complete")
Ejemplo n.º 2
0
    def take_screenshot_cropped(self):
        """Take a screenshot"""
        log.info("Clearing window")
        self.signal_update_screenshot_pic.emit(Image.new('RGB', (3, 3)))
        time.sleep(3)  # todo: this is not working, the screen is not cleared before the full function completes

        log.info("Taking screenshot")
        self.original_screenshot = take_screenshot()

        log.info("Emitting update signal")
        self.signal_update_screenshot_pic.emit(self.original_screenshot)
        log.info("signal emission complete")

        self.crop()
Ejemplo n.º 3
0
 def take_screenshot2(self):
     """Take a screenshot"""
     self.screenshot = take_screenshot()