D Declan Well-Known Member Licensed User Longtime User Aug 31, 2016 #1 Running the CameraEx example, I am trying to get the Zoom function working with a seekbar: Code: Copy Sub sbZoom_ValueChanged (Value As Int, UserChanged As Boolean) If UserChanged = False Or camEx.IsZoomSupported = False Then Return camEx.Zoom = Value / 100 * camEx.GetMaxZoom camEx.CommitParameters Log("Zoom Supported: " & camEx.IsZoomSupported) Log("Zoom Max :" & camEx.GetMaxZoom) Log("Zoom SB Value : " & Value) Log("Zoom Value : " & camEx.Zoom) End Sub However, the Zoom value is always 10 (MaxZoom) Log: Code: Copy Zoom Supported: true Zoom Max :10 Zoom SB Value : 50 Zoom Value : 10 SeekBar Max value = 100
Running the CameraEx example, I am trying to get the Zoom function working with a seekbar: Code: Copy Sub sbZoom_ValueChanged (Value As Int, UserChanged As Boolean) If UserChanged = False Or camEx.IsZoomSupported = False Then Return camEx.Zoom = Value / 100 * camEx.GetMaxZoom camEx.CommitParameters Log("Zoom Supported: " & camEx.IsZoomSupported) Log("Zoom Max :" & camEx.GetMaxZoom) Log("Zoom SB Value : " & Value) Log("Zoom Value : " & camEx.Zoom) End Sub However, the Zoom value is always 10 (MaxZoom) Log: Code: Copy Zoom Supported: true Zoom Max :10 Zoom SB Value : 50 Zoom Value : 10 SeekBar Max value = 100
S strat Active Member Licensed User Longtime User Aug 31, 2016 #2 It looks a simple syntax in the CameraexClass is caused this error. Value always set the maxzoom in the class. Cancelling the "Value=Max(Value,GetMaxZoom)" line should solve the problem. Code: Copy Public Sub setZoom(Value As Int) 'Value=Max(Value,GetMaxZoom) If isZoomSupported Then r.target = parameters r.RunMethod2("setZoom", Value, "java.lang.int") Else Log("Zoom not supported.") End If End Sub Upvote 0
It looks a simple syntax in the CameraexClass is caused this error. Value always set the maxzoom in the class. Cancelling the "Value=Max(Value,GetMaxZoom)" line should solve the problem. Code: Copy Public Sub setZoom(Value As Int) 'Value=Max(Value,GetMaxZoom) If isZoomSupported Then r.target = parameters r.RunMethod2("setZoom", Value, "java.lang.int") Else Log("Zoom not supported.") End If End Sub
Erel B4X founder Staff member Licensed User Longtime User Aug 31, 2016 #3 I've uploaded CameraEx v1.30: https://www.b4x.com/android/forum/t...mera-library-functionality.23801/#post-137749 The example includes the zoom feature. Upvote 0
I've uploaded CameraEx v1.30: https://www.b4x.com/android/forum/t...mera-library-functionality.23801/#post-137749 The example includes the zoom feature.