B4J Question ZoomImageView - capture cursor position

Peter Meares

Member
Licensed User
Longtime User
I was playing with ZoomImageView and I wanted to know if I can capture the X and Y position of the cursor.

Thanks
 

Peter Meares

Member
Licensed User
Longtime User
Thanks, that has allowed me to play around.
Moved the code to a module, and added this:
B4X:
    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:
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
Top