hwISession CaptureScreenByArea

Captures the screen to an image file.

Syntax

hwISession_handle CaptureScreenByArea type, filename, left, top, width, height, (quality)

Application

HyperWorks Tcl

Description

This command captures the screen to an image file. If the inputs for the left, top, width or height cause the image taken to have dimensions bigger than the screen, an error occurs.

Inputs

type
The file type that you want to save the captured image as. The different file types include: BMP, JPEG, TIFF, PNG or saved to the clipboard.
filename
The file name that you want to give the captured image.
left
The left coordinate of the region to capture, in pixels.
top
The top coordinate of the region to capture, in pixels.
width
The width of the region to capture, in pixels.
height
The height of the region to capture, in pixels.
(quality) (Optional)
The level of quality or compression that you want to make the image.

Example

hwi GetSessionHandle sess;
sess CaptureScreenByArea png MyPicture.png 0 0 500 250;
hwi GetSessionHandle sess1
sess1 CaptureScreenByArea "clipboard" E:\Scratch\CaptureScreenAPI_Test 0 0 500 250;

Error

Returns success (0) or an error code.

Keywords

HyperWorks

Tcl

Create