Just wondering is it possible to verify in code whether a snapshot is currently being displayed on screen?
e.g something like
Code: Select all
Bitmap screenshot1 = Ranorex.Imaging.Load("Screenshot1.png");
if (screenshot1.visible)
Thanks,
Brad.
Code: Select all
Bitmap screenshot1 = Ranorex.Imaging.Load("Screenshot1.png");
if (screenshot1.visible)
You can use 'Host.Local' as an element that contains everything for 'Imaging.Contains' or 'Validate.ContainsImage'.bsing wrote:Just wondering is it possible to verify in code whether a snapshot is currently being displayed on screen?
using ( var img = Ranorex.Imaging.Load( @"D:\Unbenannt.PNG" ) ) { bool containsImg = Ranorex.Imaging.Contains( Ranorex.Host.Local, img ); Ranorex.Report.Info( "Image visible: " + containsImg ); try { // creates report messages on success and failure Ranorex.Validate.ContainsImage( Host.Local, img, new Imaging.FindOptions() ); } catch ( Ranorex.ValidationException ) { // do something (or not) } }