Log in

View Full Version : searching multiple specific colours



zluo
06-22-2012, 04:28 AM
what can search multiple specific colours within a box in the mainscreen, and then determines where the object is? I think it was something about TPA but when i looked into it, i saw just 1 colour searching. if someone could link me to something that would be great.

Runaway
06-22-2012, 04:30 AM
Take a look at the cluster functions in my signature. :) beginner5 also has one you could probably find if you search "AND_TPA".

riwu
06-22-2012, 04:32 AM
FindColors(spiral)Tolerance? The parameter will be a TIntegerArray where u can enter multiple colors.

wantonman
06-22-2012, 04:40 AM
yeah riwu is right ... it seems like you can use some auto color functions... use findcolorsspiraltolerance wich it will serch for the array of colors specified... then after you can use something like findobjectex or something similar... though what is it your trying to do so i can further assist you?

Runaway
06-22-2012, 04:46 AM
FindColors(spiral)Tolerance? The parameter will be a TIntegerArray where u can enter multiple colors.


yeah riwu is right ... it seems like you can use some auto color functions... use findcolorsspiraltolerance wich it will serch for the array of colors specified... then after you can use something like findobjectex or something similar... though what is it your trying to do so i can further assist you?

Uh... FindColorsTolerance is "Colors" instead of "Color" because it returns multiple points found in a TPA instead of one. It has nothing to do with searching for multiple colors :p To search multiple colors with it you'd have to use a for..to..do loop:


var
Colors: TIntegerArray;
TPA: TPointArray;
i: Integer;

Colors := [11111, 22222, 33333];
for i := 0 to High(Colors) do
begin
FindColorsTolerance(TPA, Colors[i], MSX1, MSY1, MSX2, MSY2, 5);
if (Length(TPA) >= 5) then
begin
// ...
end;
end;

zluo
06-22-2012, 06:18 AM
Take a look at the cluster functions in my signature. :) beginner5 also has one you could probably find if you search "AND_TPA".

Thanks! exactly what i was looking for!