ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
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
  • "Decoding a bar code" process
  • Remark
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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. On the "Details" tab, configure the control setting:
    • Type of decoding: :
      • None: No barcode decoding.
      • StrikeOut: Decoding without viewfinder.
      • StrikeOut with viewfinder: A viewfinder shows the area in which the barcode is to be placed..
      • StrikeOut with contrasted viewfinder: A viewfinder shows the area in which the barcode is to be placed, while sections outside this area are blurred..
    • Type of bar code: Type of barcode to be decoded. All bar codes are supported.
    • Viewfinder size: Size of viewfinder area, 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 "Decode a bar code" event associated with the Camera control is used to process the bar code read via the control.
This event is executed when the bar code is detected.
This event has the following format:
PROCEDURE DécodeCodeBarre(cb est un CodeBarres)
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.
  • Warning: If the preview of the Camera field is distorted, the image to be decoded will also be distorted.
  • Decoding and taking photos:
    • If the Camera field is in "Compatible 26" mode: photos and videos cannot be recorded if barcode detection is enabled (function <Camera>.Capture returns an error in this case)..
    • 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 <Camera>.VideoStart 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 <Camera>.StopDecoding) in the "Initialization" event of the Camera control. Bar code decoding can be restarted with CameraStartDecoding (or <Camera>.StartDecoding).
  • iPhone/iPad This feature is available from iOS 7.
Minimum version required
  • Version 23
Comments
Click [Add] to post a comment

Last update: 10/04/2024

Send a report | Local help