调用 win32gui.GetPixel() 时出现不明确的 pywintypes.error

发布于 2024-11-23 22:41:39 字数 251 浏览 5 评论 0原文

因此,这是触发错误的代码行:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇妻 2024-11-30 22:41:39

我可能无意中解决了我的问题。当尝试为不支持“颜色管理”的设备调用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文