P Peter Meares Member Licensed User Longtime User Dec 17, 2020 #1 I was playing with ZoomImageView and I wanted to know if I can capture the X and Y position of the cursor. Thanks
I was playing with ZoomImageView and I wanted to know if I can capture the X and Y position of the cursor. Thanks
Erel B4X founder Staff member Licensed User Longtime User Dec 20, 2020 #2 The class code is inside the b4xlib file (it is a zip file). Take it and modify pnl_Touch. The position is available there. Upvote 0
The class code is inside the b4xlib file (it is a zip file). Take it and modify pnl_Touch. The position is available there.
P Peter Meares Member Licensed User Longtime User Dec 20, 2020 #3 Thanks, that has allowed me to play around. Moved the code to a module, and added this: B4X: Copy else if Action = pnl.TOUCH_ACTION_MOVE_NOTOUCH Then ' Added here If xui.SubExists(mCallBack, mEventName & "_MouseMoved", 0) Then CallSub3(mCallBack, mEventName & "_MouseMoved", X1, Y1) End If Else 'Log("touch cancelled") End If and this: B4X: Copy Private Sub ZoomImageView1_MouseMoved(X As Double, Y As Double) Log("Move") TF_Coords.Text = $"${X} , ${Y}"$ Log($"X = ${X} , ${Y}"$) End Sub Upvote 0
Thanks, that has allowed me to play around. Moved the code to a module, and added this: B4X: Copy else if Action = pnl.TOUCH_ACTION_MOVE_NOTOUCH Then ' Added here If xui.SubExists(mCallBack, mEventName & "_MouseMoved", 0) Then CallSub3(mCallBack, mEventName & "_MouseMoved", X1, Y1) End If Else 'Log("touch cancelled") End If and this: B4X: Copy Private Sub ZoomImageView1_MouseMoved(X As Double, Y As Double) Log("Move") TF_Coords.Text = $"${X} , ${Y}"$ Log($"X = ${X} , ${Y}"$) End Sub