指定范围:
在local函数中加入region参数,可以控制找图范围,从而提高找图效率。
region(x,y,width,height),其中x,y为范围左上角坐标,width,height为范围的宽和高
>>>t = locateOnScreen('images/test1.png', region=(0,940,1919,939))
>>>print(center(t))
Point(x=873, y=1056)
在local函数中加入region参数,可以控制找图范围,从而提高找图效率。
region(x,y,width,height),其中x,y为范围左上角坐标,width,height为范围的宽和高
>>>t = locateOnScreen('images/test1.png', region=(0,940,1919,939))
>>>print(center(t))
Point(x=873, y=1056)