Private Sub GesturesTouch(View As Object, PointerID As Int, Action As Int, X As Float, Y As Float) As Boolean 'ignore
Dim p As Point
Select Action
Case g.ACTION_DOWN, g.ACTION_POINTER_DOWN
'New Point is assigned to the new touch
p.Id = PointerID
p.Color = Colors.Transparent
TouchMap.Put(PointerID, p)
Case g.ACTION_POINTER_UP
TouchMap.Remove(PointerID)
Case g.ACTION_UP
'This is the end of this gesture
TouchMap.Clear
End Select
Dim px, py As Int
For i = 0 To TouchMap.Size - 1
p = TouchMap.GetValueAt(i)
px = g.GetX(p.id)
py = g.GetY(p.id)
If p.prevX > 0 AND p.prevY > 0 Then
Canvas.DrawLine(p.prevX, p.prevY, px, py, p.Color, 10dip)
End If
p.prevX = px
p.prevY = py
Next
pnlCoprente.Invalidate
Return True
End Sub