MylesMadness
2008-10-12 20:45:22
Function ItemDtm(I:Integer):Integer;
var
MP: TDTMPointDef;
SP: array of TDTMPointDef;
DDTM: TDTM;
TP:TPoint;
Box:TBox;
P:TpointArray;
A:Integer;
begin
Box:=InvBox(I);
If not FindColorsTolerance(P, 65536, Box.x1, Box.y1, Box.x2, Box.Y2, 0) then
Result:=-1;
If Result = -1 then exit;
TP:=ItemCoords(I);
MP.x := TP.x;
MP.y := TP.y;
MP.areasize := 1;
MP.areashape := 0;
MP.color := GetColor(TP.x, TP.y);
MP.tolerance := 10;
SetArrayLength(SP, GetArrayLength(P));
A:=high(P);
For I:=0 to A do
begin
SP[i].x := P[i].x;
SP[i].y := P[i].y;
SP[i].areasize := 1;
SP[i].areashape := 0;
SP[i].color := 65536;
SP[i].tolerance := 0;
end;
DDTM.MainPoint := MP;
DDTM.SubPoints := SP;
Result:= AddDTM(DDTM);
end;Dtms during runtime ftw