Exemple #1
0
 def grab(self, bbox=None):
     command = [PROGRAM, '-silent', '-window', 'root']
     if bbox:
         pbox = '{}x{}+{}+{}'.format(bbox[2] - bbox[0], bbox[3] - bbox[1],
                                     bbox[0], bbox[1])
         command += ['-crop', pbox]
     im = read_prog_img(command)
     return im
 def grab(self, bbox=None):
     command = [PROGRAM, "-silent", "-window", "root"]
     if bbox:
         pbox = "{}x{}+{}+{}".format(bbox[2] - bbox[0], bbox[3] - bbox[1],
                                     bbox[0], bbox[1])
         command += ["-crop", pbox]
     im = read_prog_img(command)
     return im
 def grab(self, bbox=None):
     command = [PROGRAM, "-x"]
     if bbox:
         width = bbox[2] - bbox[0]
         height = bbox[3] - bbox[1]
         command += [
             "-R{},{},{},{}".format(bbox[0], bbox[1], width, height)
         ]
     im = read_prog_img(command)
     return im
Exemple #4
0
    def grab(self, bbox=None):
        # p = EasyProcess([PROGRAM, "-version"])
        # p.enable_stdout_log = False
        # p.enable_stderr_log = False
        # p.call()

        im = read_prog_img([PROGRAM, "--silent"])
        if bbox:
            im = im.crop(bbox)
        return im
Exemple #5
0
 def grab(self, bbox=None):
     cmd = [PROGRAM, "--hidecursor"]
     if bbox:
         width = bbox[2] - bbox[0]
         height = bbox[3] - bbox[1]
         # https://github.com/naelstrof/maim/issues/119
         cmd += [
             "-g", "{}x{}+{}+{}".format(width, height, bbox[0], bbox[1])
         ]
     im = read_prog_img(cmd)
     return im
    def grab(self, bbox=None):
        if platform_is_osx():
            raise ImagemagickBackendError("osx not supported")

        command = [PROGRAM, "-silent", "-window", "root"]
        if bbox:
            pbox = "{}x{}+{}+{}".format(bbox[2] - bbox[0], bbox[3] - bbox[1],
                                        bbox[0], bbox[1])
            command += ["-crop", pbox]
        im = read_prog_img(command)
        return im
    def grab(self, bbox=None):
        if not platform_is_osx():
            raise ScreencaptureError("This backend runs only on Darwin")

        command = [PROGRAM, "-x"]
        if bbox:
            width = bbox[2] - bbox[0]
            height = bbox[3] - bbox[1]
            command += ["-R{},{},{},{}".format(bbox[0], bbox[1], width, height)]
        im = read_prog_img(command)
        return im
Exemple #8
0
    def grab(self, bbox=None):
        if platform_is_osx():
            raise ImagemagickBackendError("osx not supported")  # TODO

        # p = EasyProcess([PROGRAM, "-version"])
        # p.enable_stdout_log = False
        # p.enable_stderr_log = False
        # p.call()

        command = [PROGRAM, "-silent", "-window", "root"]
        if bbox:
            pbox = "{}x{}+{}+{}".format(bbox[2] - bbox[0], bbox[3] - bbox[1],
                                        bbox[0], bbox[1])
            command += ["-crop", pbox]
        im = read_prog_img(command)
        return im
Exemple #9
0
    def grab(self, bbox=None):
        if not platform_is_osx():
            raise ScreencaptureError("This backend runs only on Darwin")
        # p = EasyProcess([PROGRAM, "-help"])
        # p.enable_stdout_log = False
        # p.enable_stderr_log = False
        # p.call()

        command = [PROGRAM, "-x"]
        if bbox:
            width = bbox[2] - bbox[0]
            height = bbox[3] - bbox[1]
            command += [
                "-R{},{},{},{}".format(bbox[0], bbox[1], width, height)
            ]
        im = read_prog_img(command)
        return im
 def grab(self, bbox=None):
     im = read_prog_img([PROGRAM, '-f'])
     if bbox:
         im = im.crop(bbox)
     return im
Exemple #11
0
 def grab(self, bbox=None):
     if bbox:
         # using grim's built-in cropping feature
         region = self._bbox_to_grim_region(bbox)
         return read_prog_img([PROGRAM, "-g", region])
     return read_prog_img([PROGRAM])