Android Question Set Brightness of CameraEX

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is not possible to set the brightness of the panel. You can however set the camera exposure compensation.

Add these methods to CameraEx:
B4X:
Public Sub getExposureCompensation As Int
   r.target = parameters
   Return r.RunMethod("getExposureCompensation")
End Sub

Public Sub setExposureCompensation(v As Int)
   r.target = parameters
   r.RunMethod2("setExposureCompensation", v, "java.lang.int")
End Sub

Public Sub getMinExposureCompensation As Int
   r.target = parameters
   Return r.RunMethod("getMinExposureCompensation")
End Sub

Public Sub getMaxExposureCompensation As Int
   r.target = parameters
   Return r.RunMethod("getMaxExposureCompensation")
End Sub

Set the level before you commit the parameters (camera1_ready):
B4X:
camEx.ExposureCompensation = camEx.MaxExposureCompensation

Note that on the device I tested it this setting was only applied after another call to CommitParameters.
 
Upvote 0
Top