CameraEx class wraps the Camera object and using reflection and other code it extends its functionality.
CameraEx class requires Android 2.3+ and depends on
Camera library v2.20+
CameraEx features:
- Easily open the back or front camera
- Preview images and saved images orientation will match the device orientation (all orientations are supported)
- Gives access to Camera.Parameters native class (flashmode, picture size, effects and other settings)
- Includes methods to convert preview images to JPEG and to save the taken pictures.
- It should be simple to add more methods to this class
See this page for the constant values and other possible methods:
https://developer.android.com/reference/android/hardware/Camera.Parameters.html
Note that you should call CommitParameters after changing one or more parameters.
CameraExClass module is included in the attached example.
V1.30 is attached - Includes various new methods.
v1.20 - Includes all the various posts in this thread as well as AutoFocusAndTakePicture method which first calls AutoFocus and then takes a picture (if AutoFocus was successful).
Hello. When I run your example its shows "
B4A Versión: 7.30
Parseando código. (0.02s)
Compilando código (0.07s)
Compilado código de diseños (0.01s)
Organizando librerías. (0.00s)
Generando el fichero R. (0.05s)
Compilando el código Java generado. (1.38s)
Convirtiendo byte code a dex optimizado. Error
java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Exception in thread "main"
Please help me. thanks!!