I think you may want to try the cameraEx lib, it fits to the chosen device's orientation. Still, from a trial I made on a specific device, I noticed that (again, it was a test only on one specific device), the photo was rotated 90 degrees. In a portrait based app I created, I deal with this, by adding another activity with its orientation set to landscape, in order to avoid such problems, without getting into fixes.
Great! Works perfect for me. Thank´s a lot!I think you may want to try the cameraEx lib, it fits to the chosen device's orientation. Still, from a trial I made on a specific device, I noticed that (again, it was a test only on one specific device), the photo was rotated 90 degrees. In a portrait based app I created, I deal with this, by adding another activity with its orientation set to landscape, in order to avoid such problems, without getting into fixes.
of the "Public Sub Initialize" in the class modul:cam.Initialize2(Panel1, "camera", id)
Public Sub Initialize (Panel1 As Panel, FrontCamera As Boolean, TargetModule As Object, EventName As String)
target = TargetModule
event = EventName
Front = FrontCamera
Dim id As Int
id = FindCamera(Front).id
If id = -1 Then
Front = Not(Front) 'try different camera
id = FindCamera(Front).id
If id = -1 Then
ToastMessageShow("No camera found.", True)
Return
End If
End If
cam.Initialize2(Panel1, "camera", id)
End Sub
No idea what I did wrong.java.lang.ClassCastException: android.widget.Button cannot be cast to android.view.SurfaceView
Didn´work either. But by this hint I realized that the parent activity of the buttons was "Panel1". Normally it is "Activity". So I changed it to "Activity" and - it worked. Thanks a lot.Add to your layout an empty panel (for e.g. Panel2) then change your old line to this one:B4X:camEx.Initialize(Panel2, frontCamera, Me, "Camera1")