PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • Creating and configuring the Camera control to decode the bar codes
  • Creating a Camera control
  • Configuring the Camera control
  • "Decoding a bar code" process
  • 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, the bar codes can be decoded via the Camera control by 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.
"Decoding a bar code" process
When bar code decoding is enabled on the Video control, the event "Decoding a bar code" 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
  • Versions 22 and later
    CameraRequestPermission (or VideoRequestPermission) allows you to find out whether the device used is allowed to use the camera.
    New in version 22
    CameraRequestPermission (or VideoRequestPermission) allows you to find out whether the device used is allowed to use the camera.
    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).
    • Versions 27 and later
      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.
      New in version 27
      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.
      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.
    • Versions 27 and later
      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.
      New in version 27
      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.
      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.
    Versions 22 and later
    To prevent this behavior, you call call CameraStopDecoding (or VideoStopDecoding) in the event "Initializing" of the Camera control. Bar code decoding can be restarted with CameraStartDecoding (or VideoStartDecoding).
    New in version 22
    To prevent this behavior, you call call CameraStopDecoding (or VideoStopDecoding) in the event "Initializing" of the Camera control. Bar code decoding can be restarted with CameraStartDecoding (or VideoStartDecoding).
    To prevent this behavior, you call call CameraStopDecoding (or VideoStopDecoding) in the event "Initializing" 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 23
Comments
Click [Add] to post a comment