简体   繁体   中英

How to take screenshots in Python with certain pixel range?

Does anyone know of any modules or any way in Python to take a screenshot of a certain pixel range on the screen? I have been looking but couldn't find anything online.

try This one

import pyscreenshot as ImageGrab

img=ImageGrab.grab()
img=ImageGrab.grab(bbox=(10,10,500,500))

ImageGrab.grab_to_file('img.jpg')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM