0

I'm trying to take a picture of a screen so I can look at some pixels. Problem is, that on the computer it has to work on, the screenshot is only about a quarter of the screen, the rest is completely black.

It's a Win10 with Python3 and a normal 1920x1080 screen.

I've tried various different modules (PIL, pyscreenshot, autopy) and they all seem to have this issue

These are two ways I've tried doing it.

if __name__ == "__main__":
    im=pyscreenshot.grab()
    im.save("pyscr.png")

if __name__ == "__main__":
    im = ImageGrab.grab()
    im.save('pilscr.png')

Link to Picture: https://i.stack.imgur.com/Km095.jpg

1 Answers1

0

I found it out, after some more searching. This is a problem with high DPI monitors as the scaling kind of messes up everything.

  1. Go to python.exe
  2. Go to Properties --> Compatibility --> High-DPI Scaling
  3. I checked the lower box and put it on System(Enhanced) --> Maybe others work too idk
  4. Do the same for pythonw.exe

Afterwards my pictures were still only a quarter but at least everything is compressed into this part of the picture so it kind of works.

I found this information here and here respectively