Dev Direct Solution Center

For more information and to buy this product...

5 minutes to let your application recognize barcode from image

  For a copy of the sample project please click here to download and install the product evaluation.

Introduction

To recognize barcode on images is an easy thing. Download and install the barcode reader toolkit and refer codes from the sample projects(VB, VC++, VC#, Delphi). The toolkit can help you accomplish the work with a few line of codes in 5 minutes.

Detail

Step 1: Get the toolkit

Download Barcode Reader Toolkit and Sample projects using the above link and install the toolkit on your computer.

Step 2: Add reference to the toolkit

Find file barcodeR.cs in the folder "C:\Program Files\ImagesInfo\Barcode Reader Toolkit Trial\Include" and add it into your project.

Add codes to refer to the toolkit and declare instance for class.
using BarcodeReader;  // include the wrapper class for barcode reader

namespace SampleBarcodeR
{
    public partial class Form1 : Form
    {
        public barcodeR m_barcodeR; // declare an instance of barcodeR class

Step 3: Settings and Recognition

Set the barcode type you want to recognize and the direction to search.

// settings
        m_barcodeR.SetReadCode39(true);
        m_barcodeR.SetScanDirection(barcodeR._LEFT2RIGHT 
                                  | barcodeR._RIGHT2LEFT 
                                  | barcodeR._TOP2BOTTOM 
                                  | barcodeR._BOTTOM2TOP);

        m_barcodeR.SetMultipleRead(true); // to read multiple barcodes on one page
// recognize
        int nBarcode = m_barcodeR.ScanBarcodeFromFile("your image file");

Step 4: Collect results

Using a loop to get all results

        for (i = 0; i < nBarcode; i++)
        {
            sBarcode = m_barcodeR.GetBarcodeString(i); // barcode data
            nType = m_barcodeR.GetBarcodeType(i);        
            nDirection = m_barcodeR.GetBarcodeDirection(i);

            // get the boundary rectangle of barcode
            m_barcodeR.GetBarcodePosition(i, &nLeft, &nTop, &nRight, &nBottom);
        } //for i

Congradulation!

Now, you have successfully recognized barcode from image.

Visit ImagesInfo for more information and more samples.