Picture Method (Desktop Objects)

Applies to TestComplete 12.60, last modified on September 17, 2018

Description

The Desktop.Picture method captures a screenshot of the entire desktop or a specific area. The method returns a Picture object containing the captured image. The captured image can optionally include the image of the mouse cursor.

Declaration

TestObj.Picture(ClientXClientYWidthHeightMouse)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
ClientX [in]    Optional    Integer Default value: 0   
ClientY [in]    Optional    Integer Default value: 0   
Width [in]    Optional    Integer Default value: -1   
Height [in]    Optional    Integer Default value: -1   
Mouse [in]    Optional    Boolean Default value: True   
Result A Picture object

Applies To

The method is applied to the following object:

View Mode

This method is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Parameters

The method has the following parameters:

ClientX

The horizontal (X) coordinate of the left edge of the screen area to capture. 0 (default) means the left edge of the screen.

ClientY

The vertical (Y) coordinate of the top edge of the screen area to capture. 0 (default) means the top of the screen.

Width

The width (in pixels) of the screenshot to capture. -1 (default) means the width to the right edge of the screen.

Height

The height (in pixels) of the screenshot to capture. -1 (default) means the height to the bottom of the screen.

Mouse

If True (default), the captured image includes the mouse cursor image; if False, the image of the mouse cursor is not included.

Result Value

A Picture object containing the captured image.

Example

For examples of using the Desktop.Picture method, see the following topics:

Adding a Picture to the Test Log

Saving an Image to the Regions Collection

See Also

Picture Object
Desktop.PictureUnderMouse
Desktop.ActiveWindow
Desktop.Width
Desktop.Height
Desktop.MouseX
Desktop.MouseY

Highlight search results