Samples
The samples are available in GitLab and the gzipped Tarball (tar.gz) file.
Samples in GitLab
- Hello Barcode Xpress for Linux is a sample intended to help you get started with Barcode Xpress for Linux as quickly as possible.
Check it out! Instructions for building and running this sample are included: github.com/Accusoft/hello-barcode-xpress-for-linux.
Samples in the Tarball (tar.gz) File
The samples are in C++ and Python.
C++ Samples
- ReadBarcodes is a simple sample showcasing how to read barcodes from BMP images. We use CMake and Make to make building the sample easier.
- WriteBarcodes uses BX_create_file and BX_create_dib to create barcodes and then reads them back.
Building and Running the C++ Samples
To build the C++ samples:
-
Change the terminal's working directory to the directory of the sample you wish to build and run.
-
Then, use Cmake to build the sample.
cmake . && make
To run the ReadBarcodes sample:
./readbarcodes ../images/Barcode-All-Supported-Types.bmp
The WriteBarcodes sample takes in no arguments, simply run it:
./writebarcodes
Python Samples
The Python samples demonstrate using Barcode Xpress with Python and includes a wrapper module that can be dropped into other Python projects.
We have two samples that show how to use Barcode Xpress and Python together:
- ReadBarcodesPython is a basic sample that reads in barcodes on BMP images passed in via the command line and outputs the results.
- ReadBarcodesOpenCV is basically the same thing, except it uses OpenCV to read images other than BMP.
Requirements
- Python 3.6+ (for ReadBarcodesPython)
- OpenCV 2 and Numpy pip packages (for ReadBarcodesOpenCV)
Running the Python Samples
It is easy to run the Python samples, just pass in the path of the file you wish you read.
python3 ReadBarcodesPython.py ../images/Barcode-All-Supported-Types.bmp
python3 ReadBarcodesOpenCV.py ../images/Barcode-All-Supported-Types.bmp