opencv - Capturing a window in Python -


i'm looking find module, or code allow me capture processes window.

i've tried working imagegrab, captures area of screen rather binding specific process window. since i'm working small monitor can't guarantee won't lap on onto captured area of screen, sadly imagegrab solution isn't enough.

you can achieve using win32gui.

from pil import imagegrab import win32gui  hwnd = win32gui.findwindow(none, r'window_title') win32gui.setforegroundwindow(hwnd) dimensions = win32gui.getwindowrect(hwnd)  image = imagegrab.grab(dimensions) image.show() 

you move window preferred position if small screen problem. win32gui.movewindow(hwnd, 0, 0, 500, 700, true) see win32gui.movewindow


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -