Dev Center
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

How-to Guides - Get Intermediate Results

Apart from getting the results like barcode type, value, location, Dynamsoft Barcode Reader also provides APIs for you to get the intermediate results like original image, transformed grayscale image, binarized image, text zone, etc. for further analysis. To learn more about what intermediate results you can get, see enum IntermediateResultType.

Note: You will need a separate license for the intermediate results such as transformed grayscale image, binarized image, and text zone. Getting the original image of the intermediate result doesn’t require a separate license. The original image is the one that Dynamsoft Barcode Reader SDK uses to do the barcode reading. If the SDK fails to recognize the barcodes using the original image, try different settings or contact Dynamsoft Support for help.

Here we will show how to get the original image and save it to your file system:

    int iRet = -1;
    hBarcode = DBR_CreateInstance();
    DBR_InitLicense(hBarcode, "t0068MgAAAGotN***"); // Set the trial license

    DBR_GetRuntimeSettings(hBarcode,&runtimeSettings);
    runtimeSettings.intermediateResultTypes = IRT_ORIGINAL_IMAGE; 
    // Here we save it to the file system. You can also save it to memory according to your needs.
    runtimeSettings.intermediateResultSavingMode = IRSM_FILESYSTEM;
    iRet = DBR_UpdateRuntimeSettings(hBarcode,&runtimeSettings,szErrorMsg,256);
    // Set the folder path which stores the intermediate result (original image). Please make sure you have write permission to this folder.
    iRet = DBR_SetModeArgument(hBarcode, "IntermediateResultSavingMode", 0, "FolderPath", "D:\DBRLogs", szErrorMsg, 256); 
    if (iRet != DBR_OK) // If error occurs
    {
        printf("Error code: %d. Error message: %s\n", iRet, szErrorMsg);
        return -1;
    }
    DBR_DecodeFile(hBarcode, "<Your Image Path here>","");
    IntermediateResultArray* pResults;
    DBR_GetIntermediateResults(hBarcode, &pResults);

    DBR_DestroyInstance(hBarcode);

To learn more about intermediate result, please see Intermediate Result.

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

latest version

    • Latest version
    • Version 10.x
      • Version 10.2.0
      • Version 10.0.21
      • Version 10.0.20
      • Version 10.0.10
      • Version 10.0.0
    • Version 9.x
      • Version 9.6.42
      • Version 9.6.40
      • Version 9.6.33
      • Version 9.6.32
      • Version 9.6.31
      • Version 9.6.30
      • Version 9.6.20
      • Version 9.6.10
      • Version 9.6.0
      • Version 9.4.0
      • Version 9.2.0
      • Version 9.0.0
    • Version 8.x
      • Version 8.8.0
      • Version 8.6.0
      • Version 8.4.0
      • Version 8.2.0
      • Version 8.1.2
      • Version 8.1.0
      • Version 8.0.0
    • Version 7.x
      • Version 7.6.0
      • Version 7.5.0
    Change +