asd
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
"Grab the part of the screen"
|
||||
import pyscreenshot as ImageGrab
|
||||
|
||||
# part of the screen
|
||||
im = ImageGrab.grab(bbox=(10, 10, 510, 510)) # X1,Y1,X2,Y2
|
||||
|
||||
# save image file
|
||||
im.save("box.png")
|
@ -0,0 +1,8 @@
|
||||
"Grab the whole screen"
|
||||
import pyscreenshot as ImageGrab
|
||||
|
||||
# grab fullscreen
|
||||
im = ImageGrab.grab()
|
||||
|
||||
# save image file
|
||||
im.save("fullscreen.png")
|
@ -0,0 +1,14 @@
|
||||
"Create screenshot of xmessage with Xvfb"
|
||||
from time import sleep
|
||||
|
||||
from easyprocess import EasyProcess
|
||||
from pyvirtualdisplay import Display
|
||||
|
||||
import pyscreenshot as ImageGrab
|
||||
|
||||
with Display(size=(100, 60)) as disp: # start Xvfb display
|
||||
# display is available
|
||||
with EasyProcess(["xmessage", "hello"]): # start xmessage
|
||||
sleep(1) # wait for displaying window
|
||||
img = ImageGrab.grab()
|
||||
img.save("xmessage.png")
|
Reference in New Issue
Block a user