Get the bitmap of the control.

Namespace:  QAliber.Engine.Controls
Assembly:  QAliber.Engine (in QAliber.Engine.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public Bitmap GetImage()
Visual Basic (Declaration)
Public Function GetImage As Bitmap
Visual C++
public:
Bitmap^ GetImage()

Return Value

The bitmap of the control

Examples

Make sure calc is running in scientific mode In this example take the image of the hex A in decimal mode (disabled) and in Hex mode (enabled) Save the images for further analysis (e.g. comaprison)
CopyC#
System.Diagnostics.Process.Start("calc");
UIAWindow calcWin = Desktop.UIA[@"Calculator", @"SciCalc", @"UIAWindow"] as UIAWindow;
//Get disabled button image
UIAButton hexAButton = calcWin[@"A", @"Button", @"134"] as UIAButton;
System.Drawing.Image disabledButton = hexAButton.GetImage();
disabledButton.Save(@"C:\disabledButton.bmp");
UIARadioButton @hexSelect = calcWin[@"Hex", @"Button", @"306"] as UAIRadioButton;
hexSelect.Click();
// before accessing image,refresh() is recomended
hexAButton.Refresh();
disabledButton = hexAButton.GetImage();
disabledButton.Save(@"C:\enabledButton.bmp");
//See the difference
System.Diagnostics.Process.Start(@"C:\enabledButton.bmp");
System.Diagnostics.Process.Start(@"C:\disabledButton.bmp");

See Also