Well, I made them first colorfinding functions cuz i was bored, so I started thinking and came up with this, this will find a color, ignoring all coordinates in the specified TPointArray.
(BTW: It's tested if anyone would doubt it works.)Code:function FindColorSkipCoords(var x, y: Integer; color, x1, y1, x2, y2: Integer; skipcoords: TPointArray): Boolean; var p1, p2: TPoint; tmpColor, a: integer; skipB: Boolean; begin if(x1 < x2)then begin p1.x := x1; p2.x := x2; end else begin p1.x := x2; p2.x := x1; end; if(y1 < y2)then begin p1.y := y1; p2.y := y2; end else begin p1.y := y2; p2.y := y1; end; Result := False; for x := p1.x to p2.x do begin for y := p1.y to p2.y do begin skipB := False; tmpColor := GetColor(x, y); for a := 0 to GetArrayLength(skipcoords) - 1 do begin if(skipcoords[a].x = x)and(skipcoords[a].y = y)then skipB := True; end; if(GetColor(x, y) = color)and(skipB = False)then begin Result := True; Exit; end; end; end; end;







Reply With Quote


