Forum Discussion

poffin's avatar
poffin
Occasional Contributor
8 years ago
Solved

Regions.Compare images including mouse?

I'm attempting to use the Regions.Compare() method to compare the state of an object before and after I perform an operation. The images are supposed to be identical.   My problem is, I cannot get ...
  • Ryan_Moran's avatar
    8 years ago

    I believe you meant to use picture compare method and not the region compare.

     

     

    Edit:

    Also you need to specify the mouse pointer exclusion when you use the .Picture() method.

    See documentation here.

     

     

    Try this (again, lol):

     

    var wnd = Aliases.Application.MainWindow;
    var obj = wnd.Studio.ScrollViewer.ScrollViewer
    
    //take first picture specifying mouse is not to be captured
    var pic1 = obj.Picture(0, 0, -1, -1, false);
    
    //perform object drag
    wnd.Pulses.Drag(104, 220, 385, 13);
    
    //take second picture specifying mouse is not to be captured
    var pic2 = obj.Picture(0, 0, -1, -1, false);
    pic1.Compare(pic2);