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
Post a Comment