SRL Archive - Help

searching top right to bottom left


zluo

2012-05-27 03:42:06

how can we search a colour from top right to bottom left in a specific box?

or even better how can we search a colour from top right to bottom right?

thanks guys

P1nky

2012-05-27 03:46:46

for main screen: MSX1 , MSY1, MSX2 , MSY2.

If you want it to search a custom box , and not the whole main screen; Than use the color picking tool and you will see coords anywhere you hover.

YoHoJo

2012-05-27 04:00:18

^ Didn't fully answer the question.
He wants to search from a certain point of the screen 'outwards' to another point of the screen, right?

But still good helpful info!

zluo

2012-05-27 04:34:56

Yohojo that is correct and I know About normal
Color finding, I just want to know how to do what I said In first post

J J

2012-05-27 06:07:31

You could use FindColorsSpiralTolerance to get a TPA (Array of TPoint aka TPointArray). Once you have a TPA you can search through it or split it into a box.

procedure Test;
begin
FindColorsSpiralTolerance(X, Y, TPointArray, Color, X1, Y1, X2, Y2, Tolerance);
ClearTPAFromTPA(TPointArray, InvertTPA(TPAFromBox(X1, Y1, X2, Y2)));
WriteLn(''+ToStr(TPointArray)+'');
end;
1) Finds the colors and puts them in a TPA
2) Clear all points from the TPA except the box you specified
3) Writes in all the points in that box

Then you can click a point that is the nearest to a specific point you want. The point closest to the top left will have lower co-ordinates than points in the bottom right corner.
NearbyPointInArray(Point(X, Y), Distance, TPointArray); 
Will look for the nearest point in the array you define.

Just play with that and see what you get.