|
|
|
|
- Overview
- Creating and configuring the Camera control to decode the bar codes
- Creating a Camera control
- Configuring the Camera control
- Event "Decoding a bar code"
- Remark
Camera control: decoding bar codes
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: - On the "Creation" tab, in the "Graphic controls" group, click "Camera".
- Click at the desired location to create the control. The control appears in the editor.
Configuring the Camera control To configure the Camera control: - Open the control description window (select "Description" in the context menu).
- 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.
Event "Decoding a bar code" When bar code decoding is enabled on the Video control, the "Decoding 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 DécodeCodeBarre(cb est un CodeBarres) The information read can be retrieved by the BarCode variable passed as parameter. If this event returns: - 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).
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.
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). This feature is available from iOS 7.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|