Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get Coordinates of Pixels with specific color
#1
Question 
I am trying to find the coordinates of a specific color in a window.
 
Code:
Copy      Help
out
int hwnd=win("MyWindow" "MyWindow")
RECT r; r.left=55; r.top=270; r.right=120; r.bottom=275
ARRAY(int) a
GetWindowRect hwnd &r
if(!GetRectPixels(r a 1)) end "failed"
int row col
for row 0 a.len(2)
    out "row %i" row
    for col 0 a.len(1)
        out "0x%X" a[col row]

The window itself is 1600x1024, and the color always shows up in the same spot.

The rectangle boundaries:
Top Left Corner: 55,270
Top Right Corner: 120,270
Bottom Left Corner: 55,275
Bottom Right Corner: 120,275

The specific color I am looking for is hex color 10EF21 or (R:16 G:239 B:33)

This is a screenshot of the area I am looking for:
[img]data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAFCAYAAAD2S+QpAAAAI0lEQVQ4jWPg0Wn8P9IwA49O43+GV6YjBo96eqRguKdHGgYAuj9S3SYkA6kAAAAASUVORK5CYII=[/img]

The Macro currently spits out over 300k lines, and I can not find the color in the list at all.

Am I using RECT properly, or am I getting the information for a different area?

I need to know where the color 10EF21 starts (X), and where it ends (Y).
It should be only 61x5 pixels at most.

I am unsure if the screenshot is showing up properly, so I am linking it again here
[Image: bar.jpg]


Messages In This Thread
Get Coordinates of Pixels with specific color - by Darkblade - 04-09-2020, 05:33 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)