Can it be that the camera example of the camera library V2.20 works only in landscape mode? My app is in portrait mode so is there no chance to use it?
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.
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.
I had the same issue but never thought about adding another activity set to landscape... My app will only support portrait mode (when on phone).
I resorted to EZcamera lib and let the default behaviour of the camera deal with all. It works fine - but I wanted landscape views - not portrait as clooney48 does.
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.
I encountered now a bit of a problem integrating both modules in my app. I added a new activity, the class modul, the view with panel1 and 2 buttons. When I start it, the code stops at the line
of the "Public Sub Initialize" in the class modul:
B4X:
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
I get the error msg:
java.lang.ClassCastException: android.widget.Button cannot be cast to android.view.SurfaceView
It is really funny! I stripped down my app so far that there are only the 2 modules of your camera example left. I even replaced my Main module by the camera example. But it does not run! It stoppes always at the same line ("cam.Initialize2(Panel1, "camera", id)"). Enclosed I send you the Zip File. Perhaps you can have a look at it. Would be interessting.
It is really funny! I stripped down my app so far that there are only the 2 modules of your camera example left. I even replaced my Main module by the camera example. But it does not run! It stoppes always at the same line ("cam.Initialize2(Panel1, "camera", id)"). Enclosed I send you the Zip File. Perhaps you can have a look at it. Would be interessting.
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.
I have still a question concerning the jpg quality. I´ll open a new post.