Since you mentioned that you are on Windows. You can use the Win32 API
as directed in this answer Fastest way to take a screenshot with python on windows. Hope this helps.
But actually Pyscreenshot should be what you are looking for.
Take the following code for example:
from pyscreenshot import grab
im = grab(bbox=(100, 200, 300, 400))
im.show()
As you can see you can use bbox
to take screenshot that is at co-ordinates (100, 200) and has a width of 300 and a height of 400.
Also as regards the printing check out Printing using win32api. I hope these help.
Using PIL you can do a resize:
from PIL import Image
from pyscreenshot import grab
img = grab(bbox=(100, 200, 300, 400))
# to keep the aspect ratio
w = 300
h = 400
maxheight = 600
maxwidth = 800
ratio = min(maxwidth/width, maxheight/height)
# correct image size is not #oldsize * ratio#
# img.resize(...) returns a resized image and does not effect img unless
# you assign the return value
img = img.resize((h * ratio, width * ratio), Image.ANTIALIAS)
I would advise changing your program so that you can resize the image before printing
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…