Decodes the information contained in a bar code. This bar code is contained in an image (image displayed in an Image control, file of an image or image in memory).
The type of bar code to be decoded depends on the execution platform:
- Only QR Codes can be decoded.
- All bar codes managed by the system can be decoded.
Caution: The bar code must cover a large section of the source image and be sharp and clearly defined for decoding.
// Decode a QR Code from a Camera control
s is Buffer
s = dSaveImageBMP(CAM_NoName1, inMemory)
bc is BarCode
bc = BCDecode(s)
IF ErrorOccurred = False _AND_ bc.TypeBarCode = BC_QRCODE
_AND_ bc.TypeContent = bcTypeEmail THEN
Info("Email address: " + bc.Content)
<Result> = BCDecode(<Image>)
<Result>: BarCode variable
BarCode variable initialized with the information read in the bar code.
<Image>: Character string
Image of bar code to decode. This parameter can correspond to:
To find out whether the retrieval failed, use:
- the ErrorOccurred variable,
- the TypeBarCode property of the BarCode variable. If this property differs from BC_QRCODE, the bar code was not detected or decoded.
The table below presents the relationship between the TypeContent
properties of the BarCode
|Type of content||Type of value (..Content)||Remark|
|bcTypeText||Character string||Example: "WINDEV is great!"|
|bcTypePhone||Character string||Example: "0612345678"|
The members of the SMS structure (SMS.Message and SMS.Number) will be automatically filled with the values read in the bar code. The content will correspond to a string in the following format: <Number> + CR + <Message>
|Example: "0612345678<CR>Text to send"|
|bcTypeURL||Character string||Example: "http://www.google.com"|
|bcTypeMarket||Character string||Example: "market://search?q=pname:com.company.application"|
|bcTypeWiFi||Character string||Character string in the following format: |
<SSID> + TAB + <Security protocol>+ TAB + <Key>
|bcTypeEmail||Character string||Example: "email@example.com"|
The members of the mContact structure will be automatically filled with the values read in the bar code.
The Latitude and Longitude properties of the variable will be automatically filled with the values read in the barcode.