Image.captureScreen Method [AX 2012]

Captures an image from the screen by using the coordinates that are supplied in the parameter list.

public int captureScreen(
    int left, 
    int top, 
    int right, 
    int bottom)

Run On

Client

Parameters

left
Type: int
X coordinate of the upper-left corner of the part of the screen that you want to capture.
top
Type: int
Y coordinate of the upper-left corner of the part of the screen that you want to capture.
right
Type: int
X coordinate of the lower-right corner of the part of the screen that you want to capture.
bottom
Type: int
Y coordinate of the lower-right corner of the part of the screen that you want to capture.

Return Value

Type: int
0 indicates success. Other values indicate failure.

The following example captures a part of the screen and saves it to a file that is named test.bmp.

Image img = new Image(); 
 
img.captureScreen(0, 0, 100, 100); 
img.saveFile(@'C:\test.bmp');

Community Additions

ADD
Show: