Untitled

 avatar
unknown
python
15 days ago
668 B
4
Indexable
import pyautogui as pg


class printScn:
    def __init__(self):
        pass

    def scrnShot(self, file_name):
        screenshot = pg.screenshot()
        screenshot = screenshot.convert("RGB")  # Converte para RGB
        screenshot.save(file_name)
        return file_name

    def screenPosition(self, x, y, width, height, file_name):
        screenshot = pg.screenshot(
            region=(x, y, width, height)
        )  # Define a região da captura
        screenshot = screenshot.convert("RGB")
        screenshot.save(file_name)
        return file_name


robo = printScn()
robo.scrnShot("teste.jpg")
robo.screenPosition(303, 144, 814, 600, "sublime.jpg")
Editor is loading...
Leave a Comment