Dynamsoft Barcode Reader 6.3.0 - API Reference
Functions

Functions

DBR_API void * DBR_CreateInstance ()
 
DBR_API void DBR_DestroyInstance (void *hBarcode)
 
DBR_API int DBR_InitLicense (void *hBarcode, const char *pszLicense)
 
DBR_API int DBR_DecodeFile (void *hBarcode, const char *pszFileName, const char *pszTemplateName)
 
DBR_API int DBR_DecodeFileInMemory (void *hBarcode, unsigned char *pFileBytes, int nFileSize, const char *pszTemplateName)
 
DBR_API int DBR_DecodeBuffer (void *hBarcode, unsigned char *pBufferBytes, int iWidth, int iHeight, int iStride, ImagePixelFormat format, const char *pszTemplateName)
 
DBR_API int DBR_DecodeBase64String (void *hBarcode, const char *pszBase64String, const char *pszTemplateName)
 
DBR_API int DBR_DecodeDIB (void *hBarcode, HANDLE hDIB, const char *pszTemplateName)
 
DBR_API int DBR_GetAllTextResults (void *hBarcode, STextResultArray **ppResults)
 
DBR_API int DBR_GetAllLocalizationResults (void *hBarcode, SLocalizationResultArray **ppResults)
 
DBR_API void DBR_FreeTextResults (STextResultArray **ppResults)
 
DBR_API void DBR_FreeLocalizationResults (SLocalizationResultArray **ppResults)
 
DBR_API const char * DBR_GetErrorString (int iErrorCode)
 
DBR_API const char * DBR_GetVersion ()
 
DBR_API int DBR_GetRuntimeSettings (void *hBarcode, PublicRuntimeSettings *pSettings)
 
DBR_API int DBR_UpdateRuntimeSettings (void *hBarcode, PublicRuntimeSettings *pSettings, char szErrorMsgBuffer[], int nErrorMsgBufferLen)
 
DBR_API int DBR_ResetRuntimeSettings (void *hBarcode)
 

Detailed Description

Basic APIs used for running Dynamsoft Barcode Reader.

Function Documentation

◆ DBR_CreateInstance()

DBR_API void* DBR_CreateInstance ( )

Creates an instance of Dynamsoft Barcode Reader.

Returns
Returns an instance of Dynamsoft Barcode Reader. If failed, return NULL.

◆ DBR_DecodeBase64String()

DBR_API int DBR_DecodeBase64String ( void *  hBarcode,
const char *  pszBase64String,
const char *  pszTemplateName 
)

Decodes barcode from an image file encoded as a base64 string.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[in]pszBase64StringA base64 encoded string that represents an image.
[in]pszTemplateNameThe template name.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.

◆ DBR_DecodeBuffer()

DBR_API int DBR_DecodeBuffer ( void *  hBarcode,
unsigned char *  pBufferBytes,
int  iWidth,
int  iHeight,
int  iStride,
ImagePixelFormat  format,
const char *  pszTemplateName 
)

Decodes barcodes from the memory buffer containing image pixels in defined format.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[in]pBufferBytesThe array of bytes which contain the image data.
[in]iWidthThe width of the image in pixels.
[in]iHeightThe height of the image in pixels.
[in]iStrideThe stride of the image (also called scan width).
[in]formatThe image pixel format used in the image byte array.
[in]pszTemplateNameThe template name.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.

◆ DBR_DecodeDIB()

DBR_API int DBR_DecodeDIB ( void *  hBarcode,
HANDLE  hDIB,
const char *  pszTemplateName 
)

Decodes barcode from a handle of device-independent bitmap (DIB).

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[in]hDIBHandle of the device-independent bitmap.
[in]pszTemplateNameThe template name.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.

◆ DBR_DecodeFile()

DBR_API int DBR_DecodeFile ( void *  hBarcode,
const char *  pszFileName,
const char *  pszTemplateName 
)

Decodes barcodes in the specified image file.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[in]pszFileNameA string defining the file name.
[in]pszTemplateNameThe template name.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.

◆ DBR_DecodeFileInMemory()

DBR_API int DBR_DecodeFileInMemory ( void *  hBarcode,
unsigned char *  pFileBytes,
int  nFileSize,
const char *  pszTemplateName 
)

Decodes barcode from an image file in memory.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[in]pFileBytesThe image file bytes in memory.
[in]nFileSizeThe length of the file bytes in memory.
[in]pszTemplateNameThe template name.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.

◆ DBR_DestroyInstance()

DBR_API void DBR_DestroyInstance ( void *  hBarcode)

Destroys an instance of Dynamsoft Barcode Reader.

Parameters
[in]hBarcodeHandle of the barcode reader instance.

◆ DBR_FreeLocalizationResults()

DBR_API void DBR_FreeLocalizationResults ( SLocalizationResultArray **  ppResults)

Frees memory allocated for localization results.

Parameters
[in]ppResultsLocalization results.

◆ DBR_FreeTextResults()

DBR_API void DBR_FreeTextResults ( STextResultArray **  ppResults)

Frees memory allocated for text results.

Parameters
[in]ppResultsText results.

◆ DBR_GetAllLocalizationResults()

DBR_API int DBR_GetAllLocalizationResults ( void *  hBarcode,
SLocalizationResultArray **  ppResults 
)

Gets all localization barcode results. It contains all recognized barcodes and unrecognized barcodes.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[out]ppResultsBarcode localization results returned by last calling function DBR_DecodeFile/DBR_DecodeFileInMemory/DBR_DecodeBuffer/DBR_DecodeBase64String/DBR_DecodeDIB. The ppResults is allocated by SDK and should be freed by calling function DBR_FreeLocalizationResults.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.

◆ DBR_GetAllTextResults()

DBR_API int DBR_GetAllTextResults ( void *  hBarcode,
STextResultArray **  ppResults 
)

Gets all recognized barcode results.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[out]ppResultsBarcode text results returned by last calling function DBR_DecodeFile/DBR_DecodeFileInMemory/DBR_DecodeBuffer/DBR_DecodeBase64String/DBR_DecodeDIB. The ppResults is allocated by SDK and should be freed by calling function DBR_FreeTextResults.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.

◆ DBR_GetErrorString()

DBR_API const char* DBR_GetErrorString ( int  iErrorCode)

Returns the error info string.

Parameters
[in]iErrorCodeThe error code.
Returns
The error message.

◆ DBR_GetRuntimeSettings()

DBR_API int DBR_GetRuntimeSettings ( void *  hBarcode,
PublicRuntimeSettings pSettings 
)

Gets current settings and save it into a struct.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[in,out]pSettingsThe struct of template settings.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.

◆ DBR_GetVersion()

DBR_API const char* DBR_GetVersion ( )

Returns the version info string for the SDK.

Returns
The version info string.

◆ DBR_InitLicense()

DBR_API int DBR_InitLicense ( void *  hBarcode,
const char *  pszLicense 
)

Reads license key and activate the SDK.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[in]pszLicenseThe license keys.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.

◆ DBR_ResetRuntimeSettings()

DBR_API int DBR_ResetRuntimeSettings ( void *  hBarcode)

Resets all parameters to default values.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message

◆ DBR_UpdateRuntimeSettings()

DBR_API int DBR_UpdateRuntimeSettings ( void *  hBarcode,
PublicRuntimeSettings pSettings,
char  szErrorMsgBuffer[],
int  nErrorMsgBufferLen 
)

Update runtime settings with a given struct.

Parameters
[in]hBarcodeHandle of the barcode reader instance.
[in]pSettingsThe struct of template settings.
[in,out]szErrorMsgBufferThe buffer is allocated by caller and the recommended length is 256.The error message will be copied to the buffer.
[in]nErrorMsgBufferLenThe length of the allocated buffer.
Returns
Returns error code. Returns 0 if the function completed successfully, otherwise call DBR_GetErrorString to get detail message.