Forum Discussion
function Test()
{
let w;
w = Sys.Desktop.ActiveWindow().Picture(20, 20, 50, 50);
// Region1 is part of the Regions collection
if (strictEqual(Regions.FindRegion(w, "Region1")))
Log.Warning("Not found", null);
}
okay, and what will be a difference between "Regions.FindRegion" and "Regions.Compare" for difference screen resolution? How can it slow my problem?
- baxatob9 years agoCommunity Hero
You can create a collection of template images for every required resolution, and then compare exactly what you need.
- lion_99 years agoOccasional Contributor
yes, it can be a solution, but I don't now exactly in what machine my test should be run. I would like to have possibility to execute those test on different environment.
- baxatob9 years agoCommunity Hero
IF statement will help you.
You can use Sys.Desktop Height and Width properties to know the actual resolution of your test machine and to switch to the appropriate settings.
- karthick79 years agoContributor
Region Compare is like valid by a pixel-by-pixel comparison
Region Find is like normal find
- lion_99 years agoOccasional Contributor
The Regions.FindRegion method searches pixel-by-pixel for one image, specified by the PictureToSearchFor parameter, within another, represented by the PictureToSearchIn parameter, and returns the rectangular area that corresponds to the found image.
The Regions.Compare method performs a pixel-by-pixel comparison of the two specified images. If the images are identical, the method returns True and posts an informative message to the test log. Otherwise, it returns False and logs the appropriate message along with both images.