Partilhar via


Image.captureScreen(Int32, Int32, Int32, Int32) Method

Definition

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

public:
 virtual int captureScreen(int _left, int _top, int _right, int _bottom);
public virtual int captureScreen (int _left, int _top, int _right, int _bottom);
abstract member captureScreen : int * int * int * int -> int
override this.captureScreen : int * int * int * int -> int
Public Overridable Function captureScreen (_left As Integer, _top As Integer, _right As Integer, _bottom As Integer) As Integer

Parameters

_left
Int32

Y coordinate of the lower-right corner of the part of the screen that you want to capture.

_top
Int32

Y coordinate of the lower-right corner of the part of the screen that you want to capture.

_right
Int32

Y coordinate of the lower-right corner of the part of the screen that you want to capture.

_bottom
Int32

Y coordinate of the lower-right corner of the part of the screen that you want to capture.

Returns

0 indicates success. Other values indicate failure.

Remarks

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');

Applies to