Set Barcode Source

Overview

In Aspose.BarCode for C++, a source for barcode recognition can be defined in three different ways: as an image file, as a stream, or as a bitmap. Reading barcodes from files can be done using five supported image formats: BMP, PNG, JPEG, GIF, or TIFF. The implementation details for three possible modes are provided further.

Read Barcodes from File

To set the barcode recognition source as an image file, it is necessary to specify the full or relative path to this file in the BarCodeReader constructor or call the SetBarCodeImage method to pass the path to the already existing object of BarCodeReader.

Read Barcodes from Bitmap

In Aspose.BarCode for C++, it is possible to get a barcode image for reading in the form of a graphical object, namely, a bitmap. Bitmap objects are used to process images composed of pixel data. To set the recognition source as a bitmap, it is necessary to pass the created bitmap object to the BarCodeReader constructor or the SetBarCodeImage method similarly to the case of using a raster image file.

Read Barcodes from Stream

Aspose.BarCode for C++ enables the possibility to load the source barcode image from a stream (in a binary format) that is viewed as an abstraction of a byte sequence. In many cases, it may be convenient to set a recognition source as a stream object that is universal and can be accessed without a file system. In Aspose.BarCode for C++, the source stream for barcode recognition can be passed to the BarCodeReader constructor or the SetBarCodeImage method.