Sub PanelMain_Touch (Action As Int, X As Float, Y As Float)
Dim Range As Int = 25dip
Select Action
Case 0 ' Down
xi=X
yi=y
Dim Canv As Canvas
Canv.Initialize(PanelMain)
Canv.DrawCircle(X,Y,5dip,Colors.Black,True,1dip)
AddPoint(X,Y)
Case 1 ' Up
Case 2 ' Move
Dim L As Int = Sqrt(Power(X-xi,2)+Power(Y-yi,2))
Dim Canv As Canvas
Canv.Initialize(PanelMain)
Canv.DrawCircle(X,Y,5dip,Colors.Black,True,1dip)
If L>=Range Then
AddPoint(X,Y)
xi=X
yi=Y
End If
End Select
End Sub
Sub AddPoint(X As Int, Y As Int)
Dim PointNew(Point.Length+1) As Type_Point
For i=0 To Point.Length-1
PointNew(i)=Point(i)
Next
Dim P As Type_Point
P.Initialize
P.X=x
P.Y=y
PointNew(Point.Length)=p
Point=PointNew
End Sub