Take screenshot

Element that makes desktop screenshot. In case you need to take a screenshot of any running process, the Process name should be specified. If you need a screenshot of the entire desktop, leave the Process name blank.

Properties

- Title: [String] Application title

- Process name: [String] Process name

- Variable: [LTools.Desktop.DesktopInst] Variable with process reference

- Variable: [System.Drawing.Bitmap] Variable to store image

C#
LTools.Desktop.DesktopApp app = LTools.Desktop.DesktopApp.Init(wf, null, "Test_*", 20000, true, LTools.Desktop.Model.DesktopTypes.UIAUTOMATION);
//Desktop
System.Drawing.Bitmap bmp = LTools.Desktop.DesktopApp.CreateScreenshot(wf);
bmp.Save(@"C:\screen1.png");
//Application by title
bmp = app.CreateScreenshot(null, "Test_*");
bmp.Save(@"C:\screen2.png");
//Current application
bmp = app.CreateScreenshot();
bmp.Save(@"C:\screen3.png");

Python
app = LTools.Desktop.DesktopApp.Init(wf, None, "Test_*", 20000, True, LTools.Desktop.Model.DesktopTypes.UIAUTOMATION)
#Desktop
bmp = LTools.Desktop.DesktopApp.CreateScreenshot(wf);
bmp.Save("C:\\screen1.png");
#Application by title
bmp = app.CreateScreenshot(None, "Test_*");
bmp.Save("C:\\screen2.png");
#Current application
bmp = app.CreateScreenshot();
bmp.Save("C:\\screen3.png");

JavaScript
var app = _lib.LTools.Desktop.DesktopApp.Init(wf, null, "Test_*", 20000, true, _lib.LTools.Desktop.Model.DesktopTypes.UIAUTOMATION);
//Desktop
var bmp = _lib.LTools.Desktop.DesktopApp.CreateScreenshot(wf);
bmp.Save("C:\\screen1.png");
//Application by title
bmp = app.CreateScreenshot(null, "Test_*");
bmp.Save("C:\\screen2.png");
//Current application
bmp = app.CreateScreenshot();
bmp.Save("C:\\screen3.png");

Last updated