728x90
import pyautogui as pag
pag.screenshot('test.png',region=(h_width + 535, h_height-201, 80, 80))
region 의 범위를 test.png 이름으로 떨궈줌.
https://pyautogui.readthedocs.io/en/latest/screenshot.html
Calling screenshot() will return an Image object (see the Pillow or PIL module documentation for details). Passing a string of a filename will save the screenshot to a file as well as return it as an Image object.
>>> import pyautogui
>>> im1 = pyautogui.screenshot()
>>> im2 = pyautogui.screenshot('my_screenshot.png')
On a 1920 x 1080 screen, the screenshot() function takes roughly 100 milliseconds - it’s not fast but it’s not slow.
There is also an optional region keyword argument, if you do not want a screenshot of the entire screen. You can pass a four-integer tuple of the left, top, width, and height of the region to capture:
>>> import pyautogui
>>> im = pyautogui.screenshot(region=(0,0, 300, 400))
728x90
'Python' 카테고리의 다른 글
sns.heatmap plot size (0) | 2023.06.21 |
---|---|
Resource punkt not found(or wordnet) (0) | 2023.06.21 |
파이썬 화면 픽셀 RGB 구하기 (0) | 2023.06.05 |
파이썬 마우스 위치 x, y 좌표 (0) | 2023.06.05 |
알비온 온라인 자동 낚시 봇, 오토(albion fishing bot) (3) | 2023.06.05 |