pyautogui图片识别locateAllOnScreen

pyautogui图片识别locateAllOnScreen

```
import pyautogui
# image = pyautogui.screenshot()
# image.save('screen.png')
# 搜索并返回所有匹配的位置
confidence = 0.99
wechat_icon = pyautogui.locateAllOnScreen('1.png', confidence=confidence)
# matches = pyautogui.locateOnScreen('wx.png')
# print(wechat_icon)
# # 遍历匹配位置并打印
for match in wechat_icon:
print(match)
msg_input_center = pyautogui.center(match)
print(msg_input_center)
pyautogui.doubleClick(msg_input_center)
# x, y = pyautogui.position()
# print(f"鼠标当前坐标:({x}, {y})")
```

    A+
发布日期:2023年08月03日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: