Barcode Xpress for Linux v13.9 - Updated
Pass Image Data Between Different Accusoft Components
Developer Guide > How To > 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);

Is this page helpful?
Yes No
Thanks for your feedback.