Barcode Xpress for Linux v14.0 - Updated January 7, 2025
Developer Guide / How To / Pass Image Data Between Different Accusoft Components
Pass Image Data Between Different Accusoft Components

Traditionally, transferring image data between Accusoft components requires passing the image data in a DIB format. Here's an example of such a data transfer using ImageGear:

// Load the image using ImageGear HIGEAR hIGear;
AT_UINT fileSize = 0;
AT_ERRCOUNT nErrCount = IG_load_file(inputFilenameBuffer, &hIGear);
if (nErrCount > 0) {
    exit(1);
}

 // Calculate the footprint of the BMP export nErrCount = IG_fltr_save_mem_size_calc(hIGear, 0, 0, IG_SAVE_BMP_UNCOMP, 1, 0, &fileSize);
if (nErrCount > 0) {
    exit(2);
}

 // Export the BMP char* dataBuffer = (char*)malloc(fileSize);
nErrCount = IG_fltr_save_mem(hIGear, dataBuffer, 0, fileSize, IG_SAVE_BMP_UNCOMP, 1, true, &fileSize);
if (nErrCount > 0) {
    exit(2);
}

 /* ... */

 // Analyze Barcode using a 14-bytes offset to skip BMP file header BX_AnalyzeParameters  params = BX_DefaultAnalyzeParameters;
BX_AnalyzeResult      result;
BX_Status             status;
status = BX_analyze_dib(&params, dataBuffer + 14, &result);

free(dataBuffer);
IG_image_delete(hIGear);