37,743
社区成员
发帖
与我相关
我的任务
分享def get_posx(x, window_size): # 返回x相对坐标
return (window_size[2] - window_size[0]) * x / 870
def get_posy(y, window_size): # 返回y相对坐标
return (window_size[3] - window_size[1]) * y / 520
topx, topy = window_size[0], window_size[1]
img_ready = ImageGrab.grab((topx + get_posx(500, window_size), topy + get_posy(480, window_size),
topx + get_posx(540, window_size), topy + get_posy(500, window_size)))
# 查看图片
im_ready.show()