|
- Table of correspondences between the parameter to modify and the possible values for this parameter
- Required permissions
VideoParameter (Function) In french: VidéoParamètre Returns or modifies the value of a parameter for the device camera.
Warning
Remarks: - To find out the list of values supported by the camera for a given parameter, use VideoListParameter.
VideoParameter can be used in the Android emulator but not in the simulator.
// Use the maximum resolution to take a photo sListResolution is string sListResolution = VideoListParameter(vipPhotoResolution) IF ErrorOccurred = False THEN VideoParameter(vipPhotoResolution, ExtractString(sListResolution, lastRank, CR)) ELSE Error("Error while retrieving the resolutions supported by the camera.") END // Use the maximum zoom value sListZoom is string sListZoom = VideoListParameter(vipZoom) IF ErrorOccurred = False THEN nZoom is int = Val(ExtractString(sListZoom, lastRank, CR)) IF VideoParameter(vipZoom, nZoom) = False THEN Error("The camera cannot zoom.") END END // Geolocation of photos taken by the camera MyPosition is geoPosition = GPSGetPosition() VideoParameter(vipGeoPosition, MyPosition) // Set the ISO sensitivity VideoParameter(vipISO, 800)
Syntax
Retrieving the value of a parameter for the device camera Hide the details
<Result> = VideoParameter(<Parameter>)
<Result>: Type of retrieved parameter - Parameter value,
- Empty string ("") if the specified parameter is not supported by the camera or if an error occurred while retrieving the camera parameters.
If an error occurs, the ErrorOccurred variable is set to True. To get more details on the error, use ErrorInfo.
<Parameter>: Character String constant or character string Parameter for which the value will be retrieved. This parameter can correspond to: - one of the preset constants. These constants correspond to the most common parameters.
- a String corresponding to the name of the desired parameter.
Caution: the parameter name is case and accent-sensitive. See the documentation about the Android SDK or about the device to find out the name of additional supported parameters. If the specified name does not correspond to a parameter supported by the camera, the function will return an empty string. The available constants are as follows: | | vipBalance | Balance mode of whites currently supported by the camera: automatic, daylight, cloudy, ...
| vipCamera | Subscript of camera currently used:- Subscript included between 1 and the number of cameras found on the device.
- -1 if no camera is currently used.
| vipCompressionJPEG | Compression of JPEG images, corresponding to an integer included between 1 and 100.- 1: Maximum compression (low quality)
- 100: No compression (very high quality)
| vipEffect | Effect of colors currently taken into account: black and white, poster, sepia, ...
| vipFlash | Current status of camera flash: automatic, without, anti red eyes, ... | vipFlicker | Adjustment of flicker (anti-banding) currently used by the camera: automatic, none, 50Hz, 60Hz, ...
| vipFocus | Current status of camera focus: automatic, macro, fixed, ...
| vipGeoPosition | Current geolocation information: the returned value is a geoPosition variable. The following properties can be specified according to the elements supported by the camera: latitude, longitude, altitude, measurement date.
| vipISO | ISO sensibility currently used by the camera: automatic, 100, 200, 400, ...
| vipPhotoResolution | Resolution of photos taken by the camera. The value is returned in the following format:
| vipRotationAuto | Automatic rotation of photos according to the device orientation during the capture.- True: the automatic rotation is enabled.
- False: the automatic rotation is disabled.
If the automatic rotation is enabled, the photo will be saved while taking into account the orientation of the device during the capture.
The automatic rotation is enabled by default ; however, some devices do not support taking photos in portrait mode. In this case, we advise you to disable the automatic rotation and to manage the image rotation through programming.
| vipScene | Types of scenes currently used by the camera: automatic, night, sports, ...
| vipZoom | Zoom value currently used by the camera. The returned values have the following format:- 100 (1x zoom = no zoom)
- 200 (2x zoom)
- 300 (3x zoom)
- 350 (3,5x zoom)
- ...
The first value is always 100 and the last value corresponds to the maximum zoom. Example:
Remark: The function will return an empty string ("") if the device camera does not support the zoom.
|
Modifying the value of a parameter for the device camera Hide the details
<Result> = VideoParameter(<Parameter> , <Value>)
<Result>: Boolean - True if the modification of the parameter was successfully performed,
- False otherwise or if an error occurred while retrieving the camera parameters. For example, VideoParameter will return False if the specified parameter (or its value) is not supported by the camera.
If an error occurs, the ErrorOccurred variable is set to True. To get more details on the error, use ErrorInfo.
<Parameter>: Character String constant or character string Parameter for which the value will be modified. This parameter can correspond to: - one of the preset constants. These constants correspond to the most common parameters.
- a String corresponding to the name of the desired parameter.
Caution: the parameter name is case and accent-sensitive. See the documentation about the Android SDK or about the device to find out the name of additional supported parameters. If the specified name does not correspond to a parameter supported by the camera, the function will return an empty string. The available constants are as follows: | | vipBalance | Balance mode of whites for the camera.
| vipCamera | Subscript of the camera to use. Caution: the change of camera reinitializes the parameters previously defined by VideoParameter. | vipCompressionJPEG | Compression of JPEG images.
| vipEffect | Effect of colors.
| vipFlash | Flash mode that will be used by the camera. | vipFlicker | Adjustment of flicker (anti-banding) that will be used by the camera.
| vipFocus | Focus mode that will be used by the camera.
| vipGeoPosition | Geolocation information to be used.
| vipISO | ISO sensitivities supported by the camera.
| vipPhotoResolution | Definition of resolution for the photos taken by the camera.
| vipRotationAuto | Automatic rotation of photos according to the device orientation during the capture.
| vipScene | Types of scenes that will be used by the camera.
| vipZoom | Zoom value that will be used by the camera.
|
<Value>: Type corresponding to the parameter to modify New value for the parameter. See the remarks to find out the table of correspondences between the parameter to modify and the expected value. Remarks Table of correspondences between the parameter to modify and the possible values for this parameter | | Parameter to modify | Expected value |
---|
vipBalance | Balance modes for the whites supported by the camera. This parameter can correspond to one of the following constants or to a Character String variable: - vipBalanceAuto: automatic mode
- vipBalanceTwilight: twilight lighting
- vipBalanceSunny: sunny lighting
- vipBalanceFluorescent: fluorescent lighting
- vipBalanceFluorescentWarm: warm fluorescent lighting
- vipBalanceIncandescent: incandescent lighting
- vipBalanceCloudy: cloudy lighting
- vipBalanceShadow: shadow lighting
| vipCamera | Subscript of the camera to use. This parameter can correspond to:- an integer included between 1 and the number of cameras found on the device
- one of the following constants:
- vipCameraBack: the first back camera (opposite to the screen) is used.
- vipCameraFront: the first front camera (facing the screen) is used.
| vipCompressionJPEG | Compression of JPEG images. Integer included between 1 and 100: - 1: Maximum compression (low quality)
- 100: No compression (very high quality)
| vipEffect | Color effects. This parameter can correspond to one of the following constants or to a Character String variable: - vipEffectAqua: Aqua effect
- vipEffectNone: no effect
- vipEffectNegative: negative effect
- vipEffectBlackAndWhite: black and white effect
- vipEffectPoster: Poster effect
- vipEffectSolarize: solarize effect
- vipEffectSepia: sepia effect
| vipFlash | Flash modes supported by the camera. This parameter can correspond to one of the following constants or to a Character String variable: - vipFlashAuto: automatic mode (the flash is started when the lighting is not sufficient).
 This constant is not available. - vipFlashOff: flash switched off.
- vipFlashOn: flash switched on when taking the photo.
- vipFlashTorch: torch mode: continuous flash lighting.
 This constant is not available. - vipFlashRedEyes: anti red eyes mode.
 This constant is not available.
| vipFocus | Focus modes supported by the camera. This parameter can correspond to one of the following constants or to a Character String variable: - vipFocusAuto: autofocus
- vipFocusContinuous: continuous (for video recording)
- vipFocusFixed: fixed
- vipFocusInfinite: infinite
- vipFocusMacro: macro (very close subject)
- vipFocusDepthOfField: depth of field
| vipGeoPosition | Geolocation information.This parameter corresponds to a variable of type geoPosition.
| vipISO | ISO sensitivities supported by the camera. This parameter can correspond to one of the following constants or to a Character String variable: - vipISOAuto: Automatic adjustment of the sensitivity
- "100", "200", "400", "800", ...
| vipPhotoResolution | Resolution of photos taken by the camera. This parameter is using the following format:
<Width><TAB><Height>
| vipRotationAuto | Automatic rotation of photos according to the device orientation during the capture. Boolean parameter: - True: the automatic rotation is enabled.
- False: the automatic rotation is disabled.
If the automatic rotation is enabled, the photo will be saved while taking into account the orientation of the device during the capture.The automatic rotation is enabled by default ; however, some devices do not support taking photos in portrait mode. In this case, we advise you to disable the automatic rotation and to manage the image rotation through programming.
| vipScene | Types of scenes supported by the camera. This parameter can correspond to one of the following constants or to a Character String variable: - vipSceneAction: the subject is moving
- vipSceneAuto: automatic mode
- vipSceneCandle: candlelight
- vipSceneBarCode: read bar codes
- vipSceneSunset : sunset
- vipSceneFireworks: Fireworks
- vipSceneInterior: photo taken indoors
- vipSceneSnow: snow
- vipSceneNight: photo by night
- vipSceneLandscape: subject far away, landscape
- vipSceneBeach: beach
- vipScenePortrait: portrait
- vipSceneNightPortrait: portrait by night
- vipSceneSport: subject moving fast, sports
- vipSceneTheater: theater/museum (no flash)
- vipSceneVibration: correction of vibrations
| vipFlicker | Adjustments of flicker (anti-banding) supported by the camera. This parameter can correspond to one of the following constants or to a Character String variable: - vipFlickerAuto: automatic adjustment
- vipFlickerOff : no adjustment of flicker
- vipFlicker50Hz: 50 Hertz
- vipFlicker60Hz : 60 Hertz
| vipZoom | Zoom values supported by the camera. Integer variable. Example: - 100: 1x zoom = no zoom
- 200: 2x zoom
- 300: 3x zoom
- 350: 3,5x zoom
- ...
|
If the value of the parameter does not correspond to one of the above-mentioned WLangage constants, you have the ability to specify this value directly. See the documentation about the Android SDK or about the device to find out the additional values and/or use VideoListParameter to find out whether this value is supported. If the specified value is not supported by the camera, VideoParameter will return False.
Related Examples:
|
Cross-platform examples (WINDEV Mobile): WM System
[ + ] This application is an example of some of the features of WINDEV Mobile available for Android/iOS. The following system functions are used: - NFC - Multimedia control - Brightness - Volume - Wi-Fi - Bluetooth - Toast - Compass - Accelerometer - Camera control - LED - Vibration - Notifications - Drawing functions - Internet
|
Component: wd280android.aar
|
|
|
|
|
|
|