Sub SetCameraFocusTarget(x As Float, y As Float)
Dim pf As JavaObject
pf.InitializeNewInstance("android.graphics.PointF", Array(x, y))
Dim cc As Object = pf.CreateEventFromUI("dji.common.util.CommonCallbacks$CompletionCallback", "callback", Null)
GetNativeCamera.RunMethod("setFocusTarget", Array(pf, cc))
Wait For (pf) Callback_Event (MethodName As String, Args() As Object)
If Args(0) = Null Then
Log("Focus set successfully.")
Else
Log("Error setting focus: " & Args(0))
End If
End Sub
Sub GetNativeCamera As JavaObject
Dim jo As JavaObject = camera
Return jo.GetFieldJO("camera")
End Sub
You can use this code to set the focus target:
https://developer.dji.com/api-refer...mera_camerasettings_setlensfocustarget_inline
Note that the x and y values are between 0 to 1.B4X:Sub SetCameraFocusTarget(x As Float, y As Float) Dim pf As JavaObject pf.InitializeNewInstance("android.graphics.PointF", Array(x, y)) Dim cc As Object = pf.CreateEventFromUI("dji.common.util.CommonCallbacks$CompletionCallback", "callback", Null) GetNativeCamera.RunMethod("setFocusTarget", Array(pf, cc)) Wait For (pf) Callback_Event (MethodName As String, Args() As Object) If Args(0) = Null Then Log("Focus set successfully.") Else Log("Error setting focus: " & Args(0)) End If End Sub Sub GetNativeCamera As JavaObject Dim jo As JavaObject = camera Return jo.GetFieldJO("camera") End Sub
You can handle the pnlCamera touch event and then call SetCameraFocusTarget.
Public answers together with a working search engine is the key for building a knowledge base.did you just do this for me?