pyautogui.locateCenterOnScreen() 返回 None 而不是坐标 [英] pyautogui.locateCenterOnScreen() returns None instead of coordinates

查看:268
本文介绍了pyautogui.locateCenterOnScreen() 返回 None 而不是坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

import pyautogui
print (pyautogui.locateCenterOnScreen("C:\Users\Venkatesh_J\PycharmProjects\mouse_event\mouse_event.png"))

它不返回坐标,而是返回None.

Instead of returning coordinates, it returns None.

推荐答案

看起来很像 在屏幕上找不到与您的图片相符的任何内容.

Seems like it couldn't find anything matching your image on the screen.

locateCenterOnScreen(image, grayscale=False) - 返回屏幕上第一个找到的图像实例中心的 (x, y) 坐标.如果在屏幕上找不到,则返回 None.

locateCenterOnScreen(image, grayscale=False) - Returns (x, y) coordinates of the center of the first found instance of the image on the screen. Returns None if not found on the screen.

这篇关于pyautogui.locateCenterOnScreen() 返回 None 而不是坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆