0

Is it possible to get screenshot of certain window and not the entire computer screen?

My window is written with QtDesigner using main window template.The window is use to display results of calculations. How can I take a screenshot of just the one window? Is pyscreenshot able to do this?

I understand that I can do part of the screen using bbox, but if the user moves the window, it won't take the screenshot correctly.

I'm currently using pyscreenshot and it takes a screenshot of entire screen.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
dre
  • 173
  • 3
  • 18

1 Answers1

0

I've found a solution based off other posts.

Found in: Python Screenshot of inactive window PrintWindow + win32gui

To solve issue with importing modules, I downloaded pywin32 for python and use these as my imports

import win32gui
import win32ui
from  ctypes import windll
from PIL import Image
dre
  • 173
  • 3
  • 18