Aspose.BarCode  for C++

C++ Barcode Library

Create, & recognize barcodes of linear, 2D and postal types within any C++ application.

  Download Free Trial
  
 

Aspose.BarCode for C++ is a barcode API to add barcode generation & recognition capabilities, as well as export generated barcodes using different high-quality image formats. This API allows customizing barcode appearance parameters, such as bar color, background color, quality, rotation angle, x-dimension, size, captions, resolution, and a lot more. It provides encoding and decoding features for 60+ barcode types, including but not limited to QR Code, Aztec Code, Data Matrix, ISBN, Code 39, Code 93, PDF417, UPC, EAN, and GS1 Data Matrix.

Advanced C++ Barcode API Features

Custom Barcode Appearance

Aspose.BarCode for C++ allows developers to customize various appearance parameters of generated barcodes. You can adjust barcode color, border style, size, margins, rotation angle, captions, and bar width. It is possible to modify the color of background, text, and captions. Developers can generate barcode images without borders or select any of five available styles and set the required color. Barcode image size can be determined manually or defined automatically. Generated barcode images might be rotated by the specified angle clockwise or counterclockwise. The API enables producing high-quality images with anti-aliasing and specifying the required resolution.

Barcode Generation Live Example

Aspose.Barcode for C++ is a powerful API that enables developers to generate high-quality barcode images within their applications. It supports a wide range of barcode types, including linear, postal, and two-dimensional barcodes. The API allows for customization of various barcode appearance parameters. To generate barcodes, developers need to specify the required symbology, information to be encoded, and various properties. This includes setting the foreground and background colors, font, and caption alignment, as well as mane other parameters.

Code to be executed - C++


// Initialize a BarcodeGenerator class object and Set CodeText & Symbology Type
System::SharedPtr<BarcodeGenerator> generator = [&]
{
    auto tmp_0 = System::MakeObject<BarcodeGenerator>(EncodeTypes::QR, u"");
    // Set parameters
    tmp_0->get_Parameters()->get_Barcode()->get_XDimension()->set_Millimeters(2);
    tmp_0->get_Parameters()->get_Barcode()->get_CodeTextParameters()->set_Location(Aspose::BarCode::CodeLocation::Below);
    return tmp_0;
}();

// Generate image
System::SharedPtr<System::Drawing::Bitmap> lBmp = generator->GenerateBarCodeImage();
Generation result

Read Damaged Barcodes

The barcode library supports various settings to scan and decode damaged or distorted barcodes. It allows successfully reading barcode images with various defects, such as Gaussian noise, inverted colors, white spots, visual artifacts, colored background, and missing bars. To improve barcode readability, the API enables special methods and mechanisms, including median filtering, "salt-and-paper" filtering, reducing image size, and others. Moreover, the barcode library benefits from advanced methods to decode industrial Data Matrix barcodes, read severely damaged QR codes, and even restore some data from incorrect barcodes.

Barcode Recognition Live Example

The barcode API provides a useful feature for detecting and reading barcodes of over 60 popular 1D and 2D types. It only requires a few lines of code to scan barcodes, making it easy to integrate this functionality into your applications. This powerful feature allows you to scan and read barcodes from a wide range of sources, such as images, documents, etc. With the ability to detect and read so many different types of barcodes, this API is a valuable tool for a wide range of applications and industries. It can be used to automate and streamline processes, reduce the risk of errors, and improve the overall efficiency of operations. Whether you need to develop applications for retail, logistics, healthcare, or any other field, this barcode API can provide a valuable solution for barcode detection and reading tasks.

Ready to recognize Recognizing Drop a file here or click to browse *

* By uploading your files or using the service you agree with our Terms of use and Privacy Policy.

Code to be executed - C++

    
try
{
    // Create instance of BarcodeGenerator class 
    System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>("<file name>", DecodeType::AllSupportedTypes);
    while (reader->Read())
    {
        // Display code text and Symbology Type
        System::Console::WriteLine(System::String(u"CodeText: ") + reader->GetCodeText());
        System::Console::Write(System::String(u"Symbology Type: ") + reader->GetCodeType());
    }
    reader->Close();
}
catch (System::Exception& ex)
{
    System::Console::WriteLine(ex->get_Message());
}

Recognition result

What People Are Saying

Don't just take our word for it. See what users have to say about APIs.

 
 
View Case Studies
  

Support and Learning Resources