0

如何在 Autopy 中使用 PyAutoGUI 函数“LocateOnScreen()”来单击图像?有什么例子吗?文档很少。我无法在我的新笔记本电脑中使用 Pyautogui,我构建了一个机器人来点击屏幕上移动的不同图像。

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. 

>>> import autopy 

>>> Image=autopy.bitmap.Bitmap.open('C:\\Users\\carlo\\Desktop\\prueba\\Captura.png') 

>>> Imageclick=autopy.mouse.click(Image) 

Traceback (most recent call last): 
  File "<pyshell#4>", line 1, in <module> 
    Imageclick=autopy.mouse.click(Image) 
TypeError

4

1 回答 1

0
import autopy 

Image=autopy.bitmap.Bitmap.open('C:\\Users\\carlo\\Desktop\\prueba\\Captura.png') #not need to open image
autopy.mouse.smooth_move(x,y) #set x,y image in screen for move mouse to image
autopy.mouse.click() # is func not get a image, set empty or ..
于 2021-01-11T07:08:33.133 回答