ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Camera control
  • Overview
  • Creating and configuring the Camera control to decode the bar codes
  • Creating a Camera control
  • Configuring the Camera control
  • "Decode a bar code" event
  • Remark
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
In iOS and Android, bar codes can be decoded via the Camera control using BCCapture. This function opens a system window to decode the bar code. This system window cannot be customized.
Another solution consists in using the Camera control. This allows you to include the control and to decode bar codes in complex GUIs.
Creating and configuring the Camera control to decode the bar codes

Creating a Camera control

To create a Camera control:
  1. On the "Creation" tab, in the "Graphic controls" group, click "Camera".
  2. Click at the desired location to create the control. The control appears in the editor.

Configuring the Camera control

To configure the Camera control:
  1. Open the control description window (select "Description" in the context menu).
  2. In the "Details" tab, configure the control setting:
    • Type of decoding: :
      • None: No decoding.
      • Bar codes: Decoding without viewfinder.
      • Bar codes with viewfinder: A viewfinder highlights the area in which the bar code will be scanned.
      • Bar codes with highlighted viewfinder: A viewfinder highlights the area in which the bar code will be scanned and the area around it is blurred.
    • Type of bar code: Type of bar code to decode. All bar codes are supported.
    • Viewfinder size: Viewfinder size, expressed as a percentage of the visible area. This option is only available if there is a viewfinder.
"Decode a bar code" event
When bar code decoding is enabled on the Video control, the "Decode a bar code" event associated with the Camera control is used to process the bar code read via the control.
This event is run when the bar code is detected.
This event has the following format:
PROCEDURE DecodeBarCode(bc is BarCode)
The information read can be retrieved by the BarCode variable passed as parameter.
If this event returns:
Remark
  • CameraRequestPermission (or VideoRequestPermission) allows you to find out whether the device used is allowed to use the camera.
  • Caution: If the preview of Camera control is distorted, the image to decode will also be distorted.
  • Decoding and taking photos:
    • If the Camera control is in "Version-26-compatible mode": Photo and video capture are not allowed if bar code detection is enabled (VideoCapture returns an error).
    • Android If the Camera control is compatible with version 27:
      • It is possible to take pictures while bar code decoding is enabled.
      • It is not possible to record video when bar code decoding is enabled.
        • If decoding is enabled when CameraVideoStart is called, it will be stopped and restarted after the recording.
        • If CameraStartDecoding is called while a video is being recorded, decoding will be enabled after the recording.
    • iPhone/iPad If the Camera control is compatible with version 27:
      • It is possible to take pictures while bar code decoding is enabled.
      • It is possible to record video while bar code decoding is enabled.
  • When the Camera control is configured to allow the decoding of bar codes (in the description window), the decoding automatically starts when the window is opened.
    To prevent this behavior, you call call CameraStopDecoding (or VideoStopDecoding) in the "Initialization" event of the Camera control. Bar code decoding can be restarted with CameraStartDecoding (or VideoStartDecoding).
  • iPhone/iPad This feature is available from iOS 7.
Minimum version required
  • Version 21
Comments
Click [Add] to post a comment

Last update: 07/17/2023

Send a report | Local help