PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview
  • Reading a bar code in a WINDEV application
  • Reading a bar code in a Windows Mobile application
  • Reading bar codes with a Windows Mobile application
  • Reading a QR Code bar code found in an image (physical image or memory image)
  • Reading a bar code in an Android application
  • Direct reading of bar codes with an Android application
  • Reading a bar code in an iPhone/iPad application
  • Direct reading of QR Code bar codes (BCCapture function)
  • Direct reading of bar codes (Camera control)
  • Reading a bar code found in an image
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to create applications for reading bar codes.
  • Windows Mobile In most cases, in the Windows Mobile applications, the bar codes are read via industrial devices. In most cases, a single type of bar code can be read by the industrial device.
    Versions 16 and later
    For the QR Code bar codes, you also have the ability to read a bar code found in an image.
    New in version 16
    For the QR Code bar codes, you also have the ability to read a bar code found in an image.
    For the QR Code bar codes, you also have the ability to read a bar code found in an image.
    See Reading a bar code in a Windows Mobile application for more details.
  • Versions 16 and later
    Android In the Android applications, the bar code is read via the camera of the device.
    See Reading a bar code in an Android application for more details.
    New in version 16
    Android In the Android applications, the bar code is read via the camera of the device.
    See Reading a bar code in an Android application for more details.
    Android In the Android applications, the bar code is read via the camera of the device.
    See Reading a bar code in an Android application for more details.
  • iPhone/iPad In iPhone/iPad applications, it is possible to read a wide variety of bar codes. You can:
    • read the bar code via the device camera.
    • read a bar code found in an image.
    See Reading a bar code in an iOS application for more details.
Reading a bar code in a WINDEV application
Reading a bar code in a Windows Mobile application
Windows Mobile

Reading bar codes with a Windows Mobile application

Most of the constructor of industrial devices propose two modes for reading the bar codes:
  • A "Wedge" mode: no specific programming is required. The user must set the position at the desired control and scan the bar code. The control immediately receives the value of the bar code.
  • A use of their specific libraries: this method proposes an improved management of the bar codes but it requires a specific interfacing. Several examples and components are supplied with WINDEV Mobile to handle the specific devices.
Versions 16 and later
Windows Mobile

Reading a QR Code bar code found in an image (physical image or memory image)

To read a QR Code bar code found in an image:
  1. Select the image containing the bar code to decode. This image can be:
    • an image found in an Image control.
    • an image file.
    • an image found in memory.
  2. Declare (if necessary) a BarCode variable. The characteristics of the QR Code bar code will be saved in this variable.
  3. Use BCDecode to decode the QR Code bar code.
Example for reading a bar code read by a Web Camera and stored in memory:
// Decode a QR Code from a Camera control
s is Buffer
s = dSaveImageBMP(CAM_MyCamera, 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)
END
New in version 16
Windows Mobile

Reading a QR Code bar code found in an image (physical image or memory image)

To read a QR Code bar code found in an image:
  1. Select the image containing the bar code to decode. This image can be:
    • an image found in an Image control.
    • an image file.
    • an image found in memory.
  2. Declare (if necessary) a BarCode variable. The characteristics of the QR Code bar code will be saved in this variable.
  3. Use BCDecode to decode the QR Code bar code.
Example for reading a bar code read by a Web Camera and stored in memory:
// Decode a QR Code from a Camera control
s is Buffer
s = dSaveImageBMP(CAM_MyCamera, 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)
END
Windows Mobile

Reading a QR Code bar code found in an image (physical image or memory image)

To read a QR Code bar code found in an image:
  1. Select the image containing the bar code to decode. This image can be:
    • an image found in an Image control.
    • an image file.
    • an image found in memory.
  2. Declare (if necessary) a BarCode variable. The characteristics of the QR Code bar code will be saved in this variable.
  3. Use BCDecode to decode the QR Code bar code.
Example for reading a bar code read by a Web Camera and stored in memory:
// Decode a QR Code from a Camera control
s is Buffer
s = dSaveImageBMP(CAM_MyCamera, 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)
END
Reading a bar code in an Android application
Android

Direct reading of bar codes with an Android application

Two modes are available for reading bar codes:
  • Reading bar codes with BCCapture. This function decodes the information stored in a bar code by using the camera of the device.
    Remarks:
    • This function opens a new window that displays the preview from the device camera. Then, you must:
      • center the bar code to decode in the relevant area.
      • validate like for a standard snapshot.
    • In Android, the feature for decoding bar codes is using the Zxing library (http://code.google.com/p/zxing). If this library is not found on the device, it will be automatically proposed for download.
  • Versions 21 and later
    Reading bar codes via the Camera control.
    All you have to do is enable the reading of bar codes in the Camera control. A specific process is run whenever the bar code is read. This process is used to get the characteristics of the bar code read in a BarCode variable. See Camera control: decoding the bar codes for more details.
    New in version 21
    Reading bar codes via the Camera control.
    All you have to do is enable the reading of bar codes in the Camera control. A specific process is run whenever the bar code is read. This process is used to get the characteristics of the bar code read in a BarCode variable. See Camera control: decoding the bar codes for more details.
    Reading bar codes via the Camera control.
    All you have to do is enable the reading of bar codes in the Camera control. A specific process is run whenever the bar code is read. This process is used to get the characteristics of the bar code read in a BarCode variable. See Camera control: decoding the bar codes for more details.
Reading a bar code in an iPhone/iPad application
iPhone/iPad

Direct reading of QR Code bar codes (BCCapture function)

The direct reading of bar codes is performed by BCCapture. This function decodes the information stored in a bar code by using the camera of the device.
Remark: This function opens a new window that displays the preview from the device camera. Then, you must:
  • center the bar code to decode in the relevant area.
  • validate like for a standard snapshot.
The characteristics of the bar code read are stored in a BarCode variable. The value of the bar code is returned by ..RoughValue and it is displayed in the Bar Code control.
For example:
// Capture the bar code
MyBC is BarCodes
MyBC = BCCapture()

// Retrieve the content of the bar code and display it
sResult is string = MyBC..RoughValue
BCOD_MyBarCodeControl = sResult
Versions 21 and later
iPhone/iPad

Direct reading of bar codes (Camera control)

The direct reading of bar codes is run via the Camera control used in decoding mode.
Remark: The user frames the bar code. A specific process is run whenever the bar code is read. This process is used to get the characteristics of the bar code read in a BarCode variable. The value of the bar code is returned by ..RoughValue and it is displayed in the Bar Code control.
For example:
// Decoding a Bar Code process
PROCEDURE DecodeBarCode(bc is BarCode)
// Retrieve the content of the bar code and display it
sResult is string = bc..RoughValue
BCOD_MyBarCodeControl = sResult
See Camera control: decoding the bar codes for more details.
New in version 21
iPhone/iPad

Direct reading of bar codes (Camera control)

The direct reading of bar codes is run via the Camera control used in decoding mode.
Remark: The user frames the bar code. A specific process is run whenever the bar code is read. This process is used to get the characteristics of the bar code read in a BarCode variable. The value of the bar code is returned by ..RoughValue and it is displayed in the Bar Code control.
For example:
// Decoding a Bar Code process
PROCEDURE DecodeBarCode(bc is BarCode)
// Retrieve the content of the bar code and display it
sResult is string = bc..RoughValue
BCOD_MyBarCodeControl = sResult
See Camera control: decoding the bar codes for more details.
iPhone/iPad

Direct reading of bar codes (Camera control)

The direct reading of bar codes is run via the Camera control used in decoding mode.
Remark: The user frames the bar code. A specific process is run whenever the bar code is read. This process is used to get the characteristics of the bar code read in a BarCode variable. The value of the bar code is returned by ..RoughValue and it is displayed in the Bar Code control.
For example:
// Decoding a Bar Code process
PROCEDURE DecodeBarCode(bc is BarCode)
// Retrieve the content of the bar code and display it
sResult is string = bc..RoughValue
BCOD_MyBarCodeControl = sResult
See Camera control: decoding the bar codes for more details.
iPhone/iPad

Reading a bar code found in an image

In iPhone/iPad applications, it is also possible to read the characteristics of a bar code in an image.
To read a bar code found in an image:
  1. Select the image that contains the bar code to decode. This image can be:
    • an image found in an Image control.
    • an image file.
    • an image found in memory.
  2. Declare (if necessary) a BarCode variable. The characteristics of the bar code will be saved in this variable.
  3. Use BCDecode to decode the bar code.
Example for reading a bar code read by a Web Camera and stored in memory:
// Decode a QR Code found in an Image control
bc is BarCode
bc = BCDecode(IMG_BarCode)
IF ErrorOccurred = False _AND_ bc..TypeBarCode = BC_QRCODE ...
_AND_ bc..TypeContent =  bcTypeEmail THEN
Info("Email address: " + bc..Content)
END
Related Examples:
Pocket Attendance Mobile (WINDEV Mobile): Pocket Attendance
[ + ] This application is an attendance manager. It allows you to list the persons who attended a meeting.
The database is previously filled with the list of registered persons.
A bar code reader can be used to read the identifiers of the persons.
The following topics are presented in this example:
1/ the click performed on a table column
2/ the use of a browsing table
The Bar Code control Unit examples (WINDEV): The Bar Code control
[ + ] Using a Bar Code control
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment