Forum Discussion
Julia_K
13 years agoSmartBear Alumni (Retired)
Hello Ashish,
To take a picture of a mouse cursor, you can use the Picture method or the Desktop.PictureUnderMouse property.
For example, the following code uses the Picture method to make a screenshot of a mouse cursor and posts it to the test log:
function CaptureCursor()
{
// Obtains the coordinates of the mouse pointer
X = Sys.Desktop.MouseX;
Y = Sys.Desktop.MouseY;
// Captures a rectangle area of the desktop including the mouse cursor
pics = Sys.Desktop.Picture(X-20, Y-20, 40, 40, true);
// Posts the captured image to the test log
Log.Picture(pics);
}
I hope, this information helps you. Please let us know if you have additional questions.
Good luck.
Related Content
- 3 months ago
- 10 years ago
- 10 years ago
Recent Discussions
- 15 hours ago