Accusoft.BarcodeXpress10.ActiveX
Acquire an Image for Barcode Recognition

Image Options

Barcode Xpress works with 1-bit black and white images, 8-bit grayscale images, and 24-bit color images. To convert other image formats use the ImagXpress ColorDepth method or other methods with the included ImagXpress component. If you use ImageGear, use the ConvertColorSpace method.

C++ Example - Minimum C++ code to load an image using Accusoft.ImagXpress12.ActiveX
Copy Code
      //load a 1BPP, black and white image into the ImagXpress control
      m_pImagXpress->FileName = “C:\\testbarcodeimage.tif”;

      // Copy the hDib
      long hDib = m_pImagXpress->CopyDIB();

      // Analyze the barcode
      m_pBarcodeXpress->AnalyzehDib(hDib);

      // Free the hDib
      GlobalFree(LongToHandle(hDib));
VB Example - Minimum VB6 code to load an image using Accusoft.ImagXpress12.ActiveX
Copy Code
    ' Load the image
    ImagXpress1.FileName = "C:\testbarcodeimage.tif"

    ' Copy the hDib
    hDib = ImagXpress1.CopyDIB

    ' Analyze the barcode
    BarcodeXpress1.AnalyzehDib hDib

    ' Free the hDib
    GlobalFree hDib
C++ Example - Minimum C++ code to load an image using ImageGear
Copy Code
      // Create an ImageGear page
      GearCORELib::IIGPagePtr page;
      page = g_pIGCore->CreatePage();

      // Load the page from file
      m_pIGFormats->LoadPageFromFile(page, fileName, 0);

      // Export the page to a dib
      GearCORELib::IIGPlatformDIBPtr platformDib = page->PlatformDIBExport(GearCORELib::IG_DIB_EXPORT_FORMAT_WINDOWS, false, 0, 0, page->ImageWidth, page->ImageHeight, 0);
      HGLOBAL hDib = LongToHandle(platformDib->DIBPtrGet());

      // Read the barcodes
      pBarcodeXpress->AnalyzehDib(HandleToLong(hDib));
VB Example - Minimum VB6 code to load an image using ImageGear
Copy Code
    ' Load the Page
    Dim page As New IGPage
    IGFormatsCtl1.LoadPageFromFile page, fileName, 0

    ' Export the platform dib from the page
    Dim platformDib As IGPlatformDIB
    Set platformDib = page.PlatformDIBExport(IG_DIB_EXPORT_FORMAT_WINDOWS, False, 0, 0, page.ImageWidth, page.ImageHeight, 0)

    ' Get the dib handle
    Dim hDib As Long
    hDib = platformDib.DIBPtrGet

    ' Read the barcodes on the image
    bcx8.AnalyzehDib hDib

See the Recognize a Barcode topic for information on recognition.

See the Overview of Barcode Xpress topic for code examples on acquiring barcodes.

See Also

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback