Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

窗口屏幕绑定为dx11模式的情况下,如果窗口最小化过,则会报错 #115

Open
Jai-wei opened this issue Dec 13, 2023 · 1 comment

Comments

@Jai-wei
Copy link

Jai-wei commented Dec 13, 2023

Bug如下:

1. 第一步只绑定一次窗口,并让程序一直保持运行

op.BindWindow(hwnd, 'dx.d3d11', 'dx', 'windows', 1)
while(1):
    pass

2. 让程序while循环的时候最小化窗口

3. 终止上面的程序,重新运行程序并截图

op.BindWindow(hwnd, 'dx.d3d11', 'dx', 'windows', 1)
op.Capture(0, 0, 1260, 850, './1.jpg')

4. op报错:

[2023/12/13 21:52:49.025]x64info: error pInfo->width != _width || pInfo->height != _height
frame info:
hwnd:0
frameId:0
time:0
height0
width:0

5. 需要再次运行第三步的程序才会解决

  • 猜测:手动终止程序的时候没有解绑窗口,导致第二次运行绑定失败。但是第二次绑定的返回值是1,显示绑定成功?
  • 此外,在游戏运行且最小化时,如果调用dx11绑定,会使游戏直接崩溃。游戏:激战2
@Jai-wei
Copy link
Author

Jai-wei commented Dec 13, 2023

此外,如果程序一直在循环进行找图时,如果直接中断程序,再次运行也会报同样的错误:

[2023/12/14 02:08:41.013]x64info: error pInfo->width != _width || pInfo->height != _height
frame info:
hwnd:0
frameId:0
time:0
height0
width:0
  • 怀疑在截图的时候恰好中断程序,会导致崩溃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant