Android Question [Resolved]How to make a cam zoom with touch move up and down?

Douglas Farias

Expert
Licensed User
Longtime User
hi all
how can i make a cam zoom with move up and down?

i m using this

B4X:
Sub paineltransparentcamera_Touch (Action As Int, X As Float, Y As Float)


      Select Action  
          Case Activity.ACTION_DOWN
          camEx.Zoom = Value / 100 * camEx.GetMaxZoom
             camEx.CommitParameters
    Return
          Case Activity.ACTION_UP
               Log("COCsssO")
          Case Activity.ACTION_MOVE
              Log("COCqweqweqweO")
       End Select 
      
Return True
End Sub

if user move to up the panel give + zoom
else down - zoom?
 

Douglas Farias

Expert
Licensed User
Longtime User
Hi erel!
we made this!

this take the max zoom and add on panel if user move to up go to max zoom if to down (dont work) but the code is correct

look this code the code its working for example my moto g have the maxzoom = 60

with this code i make up = 60 down = 0 if i move to up i have 1 to 60 if i move to down i have 60 to 0

the zoom its working but to remove the zoom dont work, why this?

B4X:
Sub porcentagem(recebe As Int)
recebe= Abs((((recebe*100) / 100%y) - 100) / 100) * camEx.GetMaxZoom
Log(recebe)
Return recebe
End Sub

Sub paineltransparentcamera_Touch (Action As Int, X As Float, Y As Float)
    Select Case Action
    Case Activity.ACTION_MOVE
    camEx.Zoom = porcentagem(Y)
    camEx.CommitParameters   
    End Select
Return True
End Sub

i can give zoom but dont remove the zoom with no zoom = 0 max zoom = 60
if i set zoom = 60 this works, if i want set zoom to 0 again dont work

how can i make for remove the zoom?

i have tested your code here
http://www.b4x.com/android/forum/th...lass-zoom-function-to-work.35829/#post-210496
zoom with a seekbar but dont work too, i can give zoom + but not zoom -, when i give zoom + the zoom stay at max and dont back to normal.

i think this is a bug on, camex class or moto g can u help me pls?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
maybe 0 is not correct. Have you tried to set zoom = 1?
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
yes your example dont work on moto g, moto x , moto e etc
i go make a sample and send u to test in your device, the value of seekbar its important in your example?
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
i have fixed, i go make a sample and share this on forum later
 
Upvote 0
Top