Sub Activity_Touch(Action As Int, X As Float, Y As Float)
Dim x2 As Float
Select Action
Case Activity.ACTION_DOWN
x0 = pnlImage.Left ' saves the current Left value
x1 = X ' saves the current X value
Case Activity.ACTION_MOVE
x2 = x0 + X - x1 ' calculates the new Left value
x2 = Min(x2, 0) ' checks the heighest value
x2 = Max(x2, -pnlImage.Width + Activity.Width) ' checks the lowes value
pnlImage.Left = x2 ' sets the Left new value
End Select
End Sub