Screenshot (PIL)ImageGrab.grab / BitBlt on Win10 only return the Background?
Asked Answered
S

1

0

i have a big problem with windows 10, normaly i used PIL (Python) to get a nice and clean screenshot from inside a program.

but with windows 10 this does not work anymore, now i become only everything on the Desktop but my FullScreen Window is missing.

i also tryed to use:

BitBlt(screen_copy, 0, 0, width, height, screen, left, top, SRCCOPY | CAPTUREBLT)

but the result is exactly the same :(

does anybody has any solution or idea what has changed in Win10?

thank you so much.

Sisak answered 27/6, 2017 at 7:6 Comment(0)
R
0

Another approach that is really fast is the MSS module. It uses only the ctypes standard module, so it does not require any dependencies. It is OS independant, works with Windows 10 and its use is made easy:

from mss import mss

with mss() as sct:
    sct.shot()

And just find the screenshot.png file containing the screen shot of the first monitor. There are a lot of possibile customizations, you can play with ScreenShot objects and OpenCV/Numpy/PIL/etc..

Reviere answered 6/7, 2017 at 6:5 Comment(1)
Is it OK for you? If yes, could you accept the answer please?Reviere

© 2022 - 2024 — McMap. All rights reserved.