I have a Click OCR Text that works much faster if I set the clipping region to just a portion of the application window, so this is desirable.
However, if I set the clipping region for the Click OCR Text, then the next Click Image activity cannot find an image that is outside the clipping region.
It seems the clipping region is some sort of global thing. How do I reset it or set it back to the full bounds of the application window?
The red box is how I’ve set the clipping region for the Click OCR Text activity. This works great, but then it can’t find the image (circled in blue) to click.
Well I think I figured it out. I don’t know if this is the correct way to do it, but it worked.
Right after the Click OCR Text activity (which sets the clipping region to the red box above), I did a Find Element activity that gets the entire window and puts it into a variable (named clipResetElement). Then I did a Set Clipping Region activity and in the Region property I put:
New UiPath.Core.Region(New Rectangle(clipResetElement.GetAbsolutePosition.X,clipResetElement.GetAbsolutePosition.Y,clipResetElement.GetAbsolutePosition.Width,clipResetElement.GetAbsolutePosition.Height))