Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to subtract two different .Rect values from image find?
#4
I tried it, but it couldnt find the image. The next thing i tried was to add diff: but no matter what value i give it, no images are found.
Can you please help me Gintaras?

Maybe it finds images but more than two? This could be possible.
Can i choose to pick the closest one and ignore other images?
 
Code:
Copy      Help
[code]var w = wnd.find(1, "Document - WordPad", "WordPadClass");
IFImage[] image = {
@"C:\Users\User\Documents\IMG\pos1.bmp",
@"C:\Users\User\Documents\IMG\pos2.bmp",
};

var a = new List<uiimage>();
uiimage.find(w, image, IFFlags.WindowDC, diff: 70, also: o => { a.Add(o); return IFAlso.OkFindMoreOfList; });
if (a.Count == 2) {
    int dx = a[1].Rect.left - a[0].Rect.left, dy = a[1].Rect.top - a[0].Rect.top;
    print.it("1 Pos difference: ", dx, dy);
    wait.s(1);
}
else {
    print.it("Pos not found");
    wait.s(1);
}

[/code]


Messages In This Thread
RE: How to subtract two different .Rect values from image find? - by Remotehorst23 - 02-12-2023, 10:54 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)