# Screenshot by Dan Rahmel # Simple code that uses the Python Imaging Library (available for free download at # http://www.pythonware.com/products/pil/) to grab a screenshot on the # windows platform and save it as a PNG, JPEG, TIF, and GIF file

# Import Image module for writing the image import Image # Import the screenshot grabbing module import ImageGrab?

# Grab entire screenshot myimage = ImageGrab?.grab() # Display size and mode of grab g.es(myimage.size, myimage.mode) # Write various file formats myimage.save("c:/screenshot1.png", "PNG") myimage.save("c:/screenshot1.jpg", "JPEG")

# Grab the 100 x 100 part of the screen myimage = ImageGrab?.grab((0,0,100,100)) # Display size and mode of grab g.es(myimage.size, myimage.mode) # Write as GIF myimage.save("c:/screenshot1.gif", "GIF")

# Leo window screen capture by Edward K. Ream w,h,x,y = g.app.gui.get_window_info(c.frame.top) myimage = ImageGrab?.grab((x,y,w+x+8,h+y+21)) # Display size and mode of grab g.es(myimage.size, myimage.mode) # Write as an uncompressed TIFF myimage.save("c:/LeoScreenshot1?.tif", "TIFF")