Uitenhage Member Licensed User Longtime User Dec 18, 2013 #1 Hi, I cannot get the CameraEX class to zoom. It doesn't throw any exceptions in the zoom code below. In the Activity I'm using Stevel05's InputSlider class: Code: 'Callback Sub from InputSlider class Sub islZoom_PosChanged(Value As Double) Dim p1 As Int = MaxZoom*Value CamEx.Zoom = p1 CurrentZoom = CamEx.Zoom End Sub And in the CameraEx class I added these Subs from other threads (Erel's I think): Code: Public Sub IsZoomSupported As Boolean r.target = parameters Return r.RunMethod("isZoomSupported") End Sub Public Sub GetMaxZoom As Int r.target = parameters Return r.RunMethod("getMaxZoom") End Sub Public Sub getZoom() As Int r.target = parameters Return r.RunMethod("getZoom") End Sub Public Sub setZoom(ZoomValue As Int) r.target = parameters r.RunMethod2("setZoom", ZoomValue, "java.lang.int") End Sub Any clues/help would be much appreciated. Thanks, Jim
Hi, I cannot get the CameraEX class to zoom. It doesn't throw any exceptions in the zoom code below. In the Activity I'm using Stevel05's InputSlider class: Code: 'Callback Sub from InputSlider class Sub islZoom_PosChanged(Value As Double) Dim p1 As Int = MaxZoom*Value CamEx.Zoom = p1 CurrentZoom = CamEx.Zoom End Sub And in the CameraEx class I added these Subs from other threads (Erel's I think): Code: Public Sub IsZoomSupported As Boolean r.target = parameters Return r.RunMethod("isZoomSupported") End Sub Public Sub GetMaxZoom As Int r.target = parameters Return r.RunMethod("getMaxZoom") End Sub Public Sub getZoom() As Int r.target = parameters Return r.RunMethod("getZoom") End Sub Public Sub setZoom(ZoomValue As Int) r.target = parameters r.RunMethod2("setZoom", ZoomValue, "java.lang.int") End Sub Any clues/help would be much appreciated. Thanks, Jim
Erel B4X founder Staff member Licensed User Longtime User Dec 19, 2013 #2 This code should work: Code: Sub SeekBar1_ValueChanged (Value As Int, UserChanged As Boolean) If UserChanged = False OR camEx.IsZoomSupported = False Then Return camEx.Zoom = Value / 100 * camEx.GetMaxZoom camEx.CommitParameters End Sub Upvote 0
This code should work: Code: Sub SeekBar1_ValueChanged (Value As Int, UserChanged As Boolean) If UserChanged = False OR camEx.IsZoomSupported = False Then Return camEx.Zoom = Value / 100 * camEx.GetMaxZoom camEx.CommitParameters End Sub
Uitenhage Member Licensed User Longtime User Dec 20, 2013 #3 Thank You! Once again You Rock! I was missing the "camEx.CommitParameters" line. Upvote 0
A arnold steger Member Licensed User Longtime User Feb 20, 2015 #4 How can call setZoom whit SeekBar1_ValueChanged for your example ? have add in cameraexclass the code Code: 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 Last edited: Feb 20, 2015 Upvote 0
How can call setZoom whit SeekBar1_ValueChanged for your example ? have add in cameraexclass the code Code: 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 Feb 22, 2015 #5 Have you seen the code in post #2? Upvote 0
A arnold steger Member Licensed User Longtime User Feb 22, 2015 #6 Yes. Post #2 is for set max zoom? I want to set a adjustable value for zoom. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 23, 2015 #7 No. Post #2 sets the zoom based on the seekbar value. Upvote 0
A arnold steger Member Licensed User Longtime User Feb 23, 2015 #8 Run correctly. In ClassModul code was my error. Thanks Upvote 0
吳 吳界明 Member Licensed User Longtime User Aug 26, 2015 #9 I want to sets the zoom based on the seekbar value, but why can't work? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 26, 2015 #10 What is not working? Are you using the code from post #2? Upvote 0
D Declan Well-Known Member Licensed User Longtime User Jun 26, 2016 #11 I am using the code in post #1 and post #2. I have added a SeekBar in the Designer. However, the SeekBar does not show on the device screen? Upvote 0
I am using the code in post #1 and post #2. I have added a SeekBar in the Designer. However, the SeekBar does not show on the device screen?
Erel B4X founder Staff member Licensed User Longtime User Jun 27, 2016 #12 This is an old thread. Please start a new thread for this (also better if you upload your project). Upvote 0