SRL Archive - Research & Development Lounge

Easy WaterColor Fix


Naum

2008-05-18 17:15:48

Just Make a Bitmap of the water and and add tolerance (36) to it, Get the color and use that as the result.

A primitive method but never fails ;)

(Based on the Idea of Solmn Wishes);

Function FindWaterColorSquig : Integer;
Var
Water, TestColor : Integer;
Begin
Water := BitmapFromString(23, 10, 'beNrrXJ/fOYpG0dBBAB+cfBo' +
'=');
Begin

If FindBitmapToleranceIn(Water, wx, wy, MMX1, MMY1, MMX2, MMY2, 36) Then
Begin
WriteLn('WaterColor Found!');
TestColor := GetColor(wx, wy);
Result := TestColor;
end else
WriteLn('WaterColor Not Found!');
end;
end;

Have Fun!

MylesMadness

2008-05-18 17:23:20

Function FindWaterColorSquig : Integer;
Var
Water: Integer;
Begin
Water := BitmapFromString(23, 10, 'beNrrXJ/fOYpG0dBBAB+cfBo' +
'=');
Result:=AutoColorThis(Water, 36, MMX1, MMY1, MMX2, MMY2)
end;
shorter

Naum

2008-05-18 17:24:28

From: Mylesmadness
Function FindWaterColorSquig : Integer;
Var
Water: Integer;
Begin
Water := BitmapFromString(23, 10, 'beNrrXJ/fOYpG0dBBAB+cfBo' +
'=');
Res
shorter



Wont Compile :(

Yes But you find the bitmap but how will you get that into a color ;)

MylesMadness

2008-05-18 17:29:19

Try it now. Dur on my part

Naum

2008-05-18 17:35:17

I know I find it so confusing when SRL uses these advanced functions when you can just use something easier to get around the problem (no offence).