imagecapture

Syntax

imagecapture ([<window name>, [<output file>, (opt)<resolution-x>, (opt)<resolution-y>, (opt)startx, (opt)starty]])

Description

Capture snap-shot of the window. Where startx & starty are offset. If window name is not provided, then the complete X screen is captured. If output file name is not provided, then a temporary file will be created and the file name will be returned. File has to be explicitly deleted by the user.

ImplementationDetails

Refer: http://webcvs.freedesktop.org/ldtp/ldtp/python/ldtputils.py

Example

from ldtputils import *

imagecapture ('Terminal', 'out.png') # out.jpg will be created in current directory. Give absolute path to save it in some other directory.

imagecapture () # Captures the complete X screen and saves in a temp file and returns the file name.

Note:
Window title name is case sensitive

Dependency

Digwin binary - http://sourceforge.net/projects/ltfx If a specific window has to be captured, then digwin is used to get the window id.

Import utility of ImageMagick - http://www.imagemagick.org/script/import.php # Mandatory dependency, if you want to use this function.

Author:
Nagashree <mnagashree@novell.com>


Linux Desktop Testing Project