调用 win32gui.GetPixel() 时出现不明确的 pywintypes.error
因此,这是触发错误的代码行:
win32gui.GetPixel(win32gui.GetDC(self._hwndGame), x, y)
这是错误:
pywintypes.error: (0, 'GetPixel', 'No error message is available')
我不确定如何解释此错误或从哪里开始解决它。任何想法都将不胜感激。
So here's the line of code triggering the error:
win32gui.GetPixel(win32gui.GetDC(self._hwndGame), x, y)
Here's the error:
pywintypes.error: (0, 'GetPixel', 'No error message is available')
I'm not sure how to interpret this error or where to begin resolving it. Any ideas at all would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能无意中解决了我的问题。当尝试为不支持“颜色管理”的设备调用 GetPixel() 时,似乎会引发错误(在本例中)。要么就是我试图在窗口尺寸的范围之外进行 GetPixel() 。这两种情况似乎都会导致此错误。这只是我如何解决它的预感。
I may have accidentally solved my problem. It seems the error (in this case) is thrown when trying to GetPixel() for a device that doesn't support "color management." Either that or I was trying to GetPixel() outside the bounds of the window's dimensions. Both cases seemed to cause this error. This is just a hunch as to how I solved it.