Table of contents
Swift
Objective-C

This documentation is deprecated. It applies only to legacy version 9.x of Barcode Reader and must not be used for new development.

Please refer to the latest documentation and Migration Guide, which supersede this content.

Result Functions

Function Description
DBR_GetAllTextResults Get all recognized barcode results.
DBR_FreeTextResults Free memory allocated for text results.
DBR_GetIntermediateResults Get intermediate results.
DBR_FreeIntermediateResults Free memory allocated for the intermediate results.

DBR_GetAllTextResults

Get all recognized barcode results.

DBR_API int DBR_GetAllTextResults (void* barcodeReader, TextResultArray** pResults)	

Parameters
[in] barcodeReader Handle of the barcode reader instance.
[out] pResults Barcode text results returned by last calling function DBR_DecodeFile / DBR_DecodeFileInMemory / DBR_DecodeBuffer / DBR_DecodeBase64String / DBR_DecodeDIB. The results is allocated by SDK and should be freed by calling function DBR_FreeTextResults.

Return Value
Returns error code (returns 0 if the function operates successfully).
You can call DBR_GetErrorString to get detailed error message.

Code Snippet

char errorBuf[512];
DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512);
void* barcodeReader = DBR_GetInstance();
if(barcodeReader != NULL)
{
    TextResultArray* pResults;
    int errorCode = DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", "");
    DBR_GetAllTextResults(barcodeReader, &pResults);
    //... more process here
    DBR_FreeTextResults(&pResults);
    DBR_RecycleInstance(barcodeReader);
}

DBR_FreeTextResults

Free memory allocated for text results.

DBR_API void DBR_FreeTextResults (TextResultArray** pResults)	

Parameters
[in] pResults Text results.

Code Snippet

char errorBuf[512];
DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512);
void* barcodeReader = DBR_GetInstance();
if(barcodeReader != NULL)
{
	TextResultArray* pResults;
	int errorCode = DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", "");
	DBR_GetAllTextResults(barcodeReader, &pResults);
    //... more process here
	DBR_FreeTextResults(&pResults);
    DBR_RecycleInstance(barcodeReader);
}

DBR_GetIntermediateResults

Return intermediate results containing the original image, the colour clustered image, the binarized image, contours, lines, text blocks, etc.

DBR_API int DBR_GetIntermediateResults (void* barcodeReader, IntermediateResultArray** pResult)	

Parameters
[in] barcodeReader Handle of the barcode reader instance.
[out] pResult The intermediate results returned by the SDK.

Return Value
Returns error code. Possible return(s): DBR_OK.
You can call DBR_GetErrorString to get detailed error message.

Code Snippet

char errorBuf[512];
DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512);
void* barcodeReader = DBR_GetInstance();
if(barcodeReader != NULL)
{
	PublicRuntimeSettings settings;
	DBR_GetRuntimeSettings(barcodeReader, &settings);
	settings.intermediateResultTypes = IRT_ORIGINAL_IMAGE | IRT_COLOUR_CLUSTERED_IMAGE | IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE;
	char errorMessage[256];
	DBR_UpdateRuntimeSettings(barcodeReader, &settings, errorMessage, 256);
	DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", "");
	IntermediateResultArray* pResults = NULL;
	DBR_GetIntermediateResults(barcodeReader, &pResults);
    //... more process here
	DBR_FreeIntermediateResults(&pResults);
    DBR_RecycleInstance(barcodeReader);
}

DBR_FreeIntermediateResults

Frees memory allocated for the intermediate results.

DBR_API void DBR_FreeIntermediateResults (IntermediateResultArray** pResults)

Parameters
[in] pResults The intermediate results.

Code Snippet

char errorBuf[512];
DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512);
void* barcodeReader = DBR_GetInstance();
if(barcodeReader != NULL)
{
	PublicRuntimeSettings settings;
	DBR_GetRuntimeSettings(barcodeReader, &settings);
	settings.intermediateResultTypes = IRT_ORIGINAL_IMAGE | IRT_COLOUR_CLUSTERED_IMAGE | IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE;
	char errorMessage[256];
	DBR_UpdateRuntimeSettings(barcodeReader, &settings, errorMessage, 256);
	DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", "");
	IntermediateResultArray* pResults = NULL;
	DBR_GetIntermediateResults(barcodeReader, &pResults);
    //... more process here
	DBR_FreeIntermediateResults(&pResults);
    DBR_RecycleInstance(barcodeReader);
}

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: