hwISession CaptureWindow

Creates an image file of a window on the current page.

Syntax

hwISession_handle CaptureWindow win_id, type, filename, dimension_type, width, height, quality

Application

Tcl Modify

Inputs

win_id
The ID of the window which needs to be captured.
type
The type of file. Options include: BMP, JPEG, TIFF, PNG, and Clipboard.
filename
The file name of the captured image.
dimension_type
Specifies the width and height units of the final image, which can be in percent or pixels.
width
The width of the captured image in percent/pixels.
height
The height of the captured image in percent/pixels.
quality (Optional)
The level of compression (default is 100). This is used only in JPEG type captures.

Example

To determine if the current plot is drawn with a uniform aspect ratio (in other words, equal width and height):
hwi GetSessionHandle sess
sess CaptureWindow 1 png Pic.png percent 150 150;
sess CaptureWindow 2 jpeg Pic.jpeg pixels 1280 960 90;

Error

Success (0) or an error code.