Open ZakiuC opened 2 years ago
截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。') 截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。') 截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。') Traceback (most recent call last): File "H:\Code Files\Python\Pycharm\DouZero_For_HLDDZ_FullAuto\DouZero_For_HLDDZ_FullAuto-main\debug_screenshot.py", line 7, in img = gh.DrawRectWithText(img, (313, 747, 1144, 200), "test") File "H:\Code Files\Python\Pycharm\DouZero_For_HLDDZ_FullAuto\DouZero_For_HLDDZ_FullAuto-main\GameHelper.py", line 29, in DrawRectWithText img = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'cvtColor'
Overload resolution failed: src data type = 17 is not supported Expected Ptr for argument 'src'
Overload resolution failed:
用管理员身份运行
main函数里 176行 self.Handle = win32gui.FindWindow("Hlddz", None), 需要把里面“hlddz”改成你自己运行的斗地主的代码
截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。') 截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。') 截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。') Traceback (most recent call last): File "H:\Code Files\Python\Pycharm\DouZero_For_HLDDZ_FullAuto\DouZero_For_HLDDZ_FullAuto-main\debug_screenshot.py", line 7, in
img = gh.DrawRectWithText(img, (313, 747, 1144, 200), "test")
File "H:\Code Files\Python\Pycharm\DouZero_For_HLDDZ_FullAuto\DouZero_For_HLDDZ_FullAuto-main\GameHelper.py", line 29, in DrawRectWithText
img = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'cvtColor'