Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scan Multiple Images
#1
I am trying to use the Find Image dialogue window to locate multiple images on the screen and then left click them. I've attempted to use the "Match #", to which I limit the search area to the whole window. When I execute the macro, it locates the image that I specified, but when I execute it again it does not locate all of the other images that are on screen. When I try to use "Variable for multiple results", I define a variable but am confused on what to do after that.

Why is scan only finding the image where I captured it in the window? It should be finding all of the other images as well...
#2
When in dialog "Find image" you select 'variable for multiple results', it shows in QM output how the variable can be used. Copy/paste or drag/drop the code to the macro.
Macro Macro2467
Code:
Copy      Help
ARRAY(RECT) a
int w=win("Firefox" "MozillaWindowClass")
scan "image:h43E41782" w 0 2|16 0 a
;sample code, shows how to use the array
out
int i
for i 0 a.len
,RECT& rr=a[i]
,mou rr.left rr.top
,0.5
#3
Okay, thanks for your response. Now that I've somewhat learned how to use the array (not sure what some of the code means: len; getting string length? Of which string, the RECT?), I have little understanding of this feature. Still, it only moves my mouse to the image that I selected when pressing Capture, even though there are other images of the exact same in the client window.

What do you think is going on? How come it's not finding the other images? I set the search area to basically the whole window...


Function collect
Code:
Copy      Help
RECT r
SetRect &r 8 8 792 543
ARRAY(RECT) a
scan "image:h316208CC" wndBS r 1|16 0 a
int i
for i 0 a.len
,RECT& rr=a[i]
,mou rr.left rr.top
,0.5
#4
Maybe other images are not exactly the same, or not in the rectangle.
Insert this line after the scan line, it shows how many images found:
out a.len


Forum Jump:


Users browsing this thread: 1 Guest(s)