How to get rectangle between 2 images coordinate

studio

#1

I have to take snapshot of browser content. I want to get it between top right image to bottom left image. I have both image’s coordinate. How to create a rectangle. I will pass this rectangle to snapshot activity.

Pls assist. If any other option pls let me know .


#2

IYou could do f3 and select the difference region. Sticking to your question(imagining visually), try below way and see if it works:

rect = new Rectangle(img1.Right,img2.Top,img2.Left,img2.Bottom)

and pass this into Set Clipping - Region - New UiPath.Core.Region(rect1)

Then do take screenshot.

Alternatively, (a bit overboard)

rect1 = new Rectangle(img1.left,img1.Top,img2.left,img1.Bottom)

rect2 = new Rectangle(img1.left,img2.Top,img2.Right,img2.Bottom)

and pass this into Set Clipping - Region -

New UiPath.Core.Region(rect3.Intersect(rect1,rect2))