B4A Library Camera library v2.20

The camera library was updated.
It now also supports the front camera.

There were several internal improvements required for the CameraEx class.

Installation instructions:
- Unzip the attached file and copy both files to the internal libraries folder.

Edit:
V2.20 is attached. Adds Camera.AutoFocus and Camera.CancelAutoFocus methods. CameraEx class was also updated and it includes a new FocusAndTakePicture method.
V2.10 is attached. The camera management code was rewritten to fix stability issues.
 

Attachments

  • Camera.zip
    11.9 KB · Views: 4,224

Douglas Farias

Expert
Licensed User
Longtime User
This lib show 3809 suported devices on google play and my device dont is in the list and works fine the lib and exemple
 

ThePuiu

Active Member
Licensed User
Longtime User
hi, I try to add a mask layer (a panel with a transparent area [PNG file] on it) above the panel that contains the camera picture.
get the error message: An error has occurred in sub: java.lang.ClassCastException:anywheresoftware.b4a.BALayout cannot be cast to android.view.SurfaceView

Is possible to do what I want?
 

mindcom

Member
Licensed User
Longtime User
Hi Erel,
I'm writing code on a Galaxy K Zoom and I find that the pictures that I have saved using this library are stretched horizontally. To give you an idea, if I take a picture 5184 x 3888 of a square printed on a A4 paper, I have that the ratio between hight and width is < 1 (11/12 = about 0.91). If I take the same picture with the camera application of the smartphone the ratio is 1.
Do you have an explanation?

I wonder whether it is due to the fact that that class (http://developer.android.com/reference/android/hardware/Camera.Parameters.html) was deprecated in API level 21.

Thank you
 

mindcom

Member
Licensed User
Longtime User
yes, I'm using CameraEx class and already tested all the available picture size.
With the other picture size the situation is worse. Ratios to 0.6.
 

mindcom

Member
Licensed User
Longtime User
Try to change to a different picture size with CameraEx class.
Also tested on Galaxy S4 and Galaxy S5 with all picture size. No problem at all.
It seems to be something related to the Galaxy K Zoom. Any Idea?
 

ibonk64

Member
Licensed User
Longtime User
how to give any sign of taking pictures and stored in the file picture.

attach the sample.
 

Attachments

  • sample.jpg
    sample.jpg
    30.7 KB · Views: 249

Alina

New Member
Licensed User
Hi Guys. I'm just a beginner at B4A, doing my first app, sorry for so basic question.
I downloaded camera library (version 2.20), but don't know any coding, what need to insert into my app? I see many information about cameras here, but that's not my level of understanding yet.:(
If anyone can advise or maybe give a link if there was any kind this discussion, i will appreciate a lot!
 

erasmusackon

Member
Licensed User
Longtime User
Erel, I have implemented the sample code in my application and it takes more than a minute for the camera to open. Please am i doing something wrong?
 

Declan

Well-Known Member
Licensed User
Longtime User
Running the CameraEx example, I am trying to get the Zoom function working with a seekbar:
B4X:
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:
B4X:
Zoom Supported: true
Zoom Max :10
Zoom SB Value : 50
Zoom Value : 10
SeekBar Max value = 100
 
Top