Home > Software engineering >  Take a screen shot of a specif area and save as variable
Take a screen shot of a specif area and save as variable

Time:12-12

I want to make a program taking a cropped screenshot (like Windows Shift s) and save it as variable, not as a file.

  1. How do I Programmatically open this win shift s window?

  2. How to directly get the output without saving this as a picture?

I'm using python

CodePudding user response:

you will need to:

  1. trigger the Print screen key (any keyboard library should allow it)
  2. retrieve the data from the clipboard (you will maybe forced to save it as a temporary file and then read from it)
  3. then parse the data it will be it will png format.
  • Related