Dynamsoft Barcode Reader 6.3.0 - API Reference
Public Member Functions | Properties | List of all members
Dynamsoft.Barcode.BarcodeReader Class Reference

Defines a class that provides functions for working with extracting barcode data. More...

Public Member Functions

 BarcodeReader ()
 Default constructor More...
 
 BarcodeReader (string strLicenseKey)
 Constructor with a given license key More...
 
Basic Functions
TextResult [] DecodeBase64String (string strBase64, string templateName)
 Decodes barcode from an image file encoded as a base64 string. More...
 
TextResult [] DecodeBitmap (Bitmap image, string templateName)
 Decodes barcode from a bitmap. More...
 
TextResult [] DecodeBuffer (byte[] bytBuffer, int iWidth, int iHeight, int iStride, EnumImagePixelFormat emFormat, string templateName)
 Decodes barcodes from the memory buffer containing image pixels in defined format. More...
 
TextResult [] DecodeFile (string strFileName, string templateName)
 Decodes barcodes in a specified image file. More...
 
TextResult [] DecodeFileInMemory (byte[] bytFileStream, string templateName)
 Decodes barcodes from an image file in memory. More...
 
LocalizationResult [] GetAllLocalizationResults ()
 Gets all localization barcode results. It contains all recognized barcodes and unrecognized barcodes. More...
 
PublicRuntimeSettings GetRuntimeSettings ()
 Gets current settings and save it into a struct. More...
 
void UpdateRuntimeSettings (PublicRuntimeSettings settings)
 Update runtime settings with a given struct. More...
 
void ResetRuntimeSettings ()
 Resets all parameters to default values. More...
 
Advanced Functions
EnumErrorCode InitRuntimeSettingsWithFile (string jsonFileName, EnumConflictMode emSettingPriority, out string errorMessage)
 Initialize runtime settings with the settings in given JSON file. More...
 
EnumErrorCode InitRuntimeSettingsWithString (string jsonContent, EnumConflictMode emSettingPriority, out string errorMessage)
 Initialize runtime settings with the settings in given JSON string. More...
 
EnumErrorCode AppendTplFileToRuntimeSettings (string jsonFileName, EnumConflictMode emSettingPriority, out string errorMessage)
 Append a new template file to current runtime settings. More...
 
EnumErrorCode AppendTplStringToRuntimeSettings (string jsonContent, EnumConflictMode emSettingPriority, out string errorMessage)
 Append a new template string to current runtime settings. More...
 
string [] GetAllParameterTemplateNames ()
 Gets the parameter templates name array. More...
 
string OutputSettingsToString (string settingsName)
 Outputs runtime settings to a string. More...
 
void OutputSettingsToFile (string outputFilePath, string settingsName)
 Outputs runtime settings and save it into a settings file (JSON file). More...
 
Compatible Functions
void LoadSettingsFromFile (string jsonFileName)
 Ensure compatibility with earlier versions. It is functionally equivalent to InitRuntimeSettingsWithFile with conflict mode ECM_Overwrite as default. More...
 
void LoadSettings (string jsonContent)
 Ensure compatibility with earlier versions. It is functionally equivalent to InitRuntimeSettingsWithString with conflict mode ECM_Overwrite as default. More...
 
void AppendParameterTemplateFromFile (string jsonFileName)
 Ensure compatibility with earlier versions. It is functionally equivalent to AppendTplFileToRuntimeSettings with conflict mode ECM_Overwrite as default. More...
 
void AppendParameterTemplate (string jsonContent)
 Ensure compatibility with earlier versions. It is functionally equivalent to AppendTplStringToRuntimeSettings with conflict mode ECM_Overwrite as default. More...
 
PublicParameterSettings GetTemplateSettings (string strImageTemplateName)
 Ensure compatibility with earlier versions. It is functionally equivalent to GetRuntimeSettings. More...
 
void SetTemplateSettings (PublicParameterSettings settings)
 Ensure compatibility with earlier versions. It is functionally equivalent to UpdateRuntimeSettings. More...
 

Properties

string LicenseKeys [get, set]
 License key used for Dynamsoft Barcode Reader. More...
 

Detailed Description

Defines a class that provides functions for working with extracting barcode data.

Four methods are now supported for editing runtime settings - reset, initialize, append, update.

Constructor & Destructor Documentation

◆ BarcodeReader() [1/2]

Dynamsoft.Barcode.BarcodeReader.BarcodeReader ( )
inline

Default constructor

◆ BarcodeReader() [2/2]

Dynamsoft.Barcode.BarcodeReader.BarcodeReader ( string  strLicenseKey)
inline

Constructor with a given license key

Member Function Documentation

◆ AppendParameterTemplate()

void Dynamsoft.Barcode.BarcodeReader.AppendParameterTemplate ( string  jsonContent)
inline

Ensure compatibility with earlier versions. It is functionally equivalent to AppendTplStringToRuntimeSettings with conflict mode ECM_Overwrite as default.

Parameters
jsonContentA JSON string that represents the content of the settings.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.


Deprecated:
AppendParameterTemplate
See also
AppendTplStringToRuntimeSettings

◆ AppendParameterTemplateFromFile()

void Dynamsoft.Barcode.BarcodeReader.AppendParameterTemplateFromFile ( string  jsonFileName)
inline

Ensure compatibility with earlier versions. It is functionally equivalent to AppendTplFileToRuntimeSettings with conflict mode ECM_Overwrite as default.

Parameters
jsonFileNameThe path of the settings file.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.


Deprecated:
AppendParameterTemplateFromFile
See also
AppendTplFileToRuntimeSettings

◆ AppendTplFileToRuntimeSettings()

EnumErrorCode Dynamsoft.Barcode.BarcodeReader.AppendTplFileToRuntimeSettings ( string  jsonFileName,
EnumConflictMode  emSettingPriority,
out string  errorMessage 
)
inline

Append a new template file to current runtime settings.

Parameters
jsonFileNameThe path of the settings file.
emSettingPriorityThe parameter setting mode, which decides to inherit parameters from previous template setting or overwrite previous settings and replace by new template.
errorMessageOutput parameter storing detailed error message.
Returns
Returns error code.

◆ AppendTplStringToRuntimeSettings()

EnumErrorCode Dynamsoft.Barcode.BarcodeReader.AppendTplStringToRuntimeSettings ( string  jsonContent,
EnumConflictMode  emSettingPriority,
out string  errorMessage 
)
inline

Append a new template string to current runtime settings.

Parameters
jsonContentA JSON string that represents the content of the settings.
emSettingPriorityThe parameter setting mode, which decides to inherit parameters from previous template setting or overwrite previous settings and replace by new template.
errorMessageOutput parameter storing detailed error message.
Returns
Returns error code.

◆ DecodeBase64String()

TextResult [] Dynamsoft.Barcode.BarcodeReader.DecodeBase64String ( string  strBase64,
string  templateName 
)
inline

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

Parameters
strBase64A base64 encoded string that represents an image.
templateNameThe template name.
Returns
All barcode text results decoded successfully.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

◆ DecodeBitmap()

TextResult [] Dynamsoft.Barcode.BarcodeReader.DecodeBitmap ( Bitmap  image,
string  templateName 
)
inline

Decodes barcode from a bitmap.

Parameters
imageThe image to be decoded.
templateNameThe template name.
Returns
All barcode text results decoded successfully.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

◆ DecodeBuffer()

TextResult [] Dynamsoft.Barcode.BarcodeReader.DecodeBuffer ( byte []  bytBuffer,
int  iWidth,
int  iHeight,
int  iStride,
EnumImagePixelFormat  emFormat,
string  templateName 
)
inline

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

Parameters
bytBufferThe array of bytes which contain the image data.
iWidthThe width of the image in pixels.
iHeightThe height of the image in pixels.
iStrideThe stride of the image (also called scan width).
emFormatThe image pixel format used in the image byte array.
templateNameThe template name.
Returns
All barcode text results decoded successfully.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

◆ DecodeFile()

TextResult [] Dynamsoft.Barcode.BarcodeReader.DecodeFile ( string  strFileName,
string  templateName 
)
inline

Decodes barcodes in a specified image file.

Parameters
strFileNameA string defining the file name.
templateNameThe template name.
Returns
All barcode text results decoded successfully.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

◆ DecodeFileInMemory()

TextResult [] Dynamsoft.Barcode.BarcodeReader.DecodeFileInMemory ( byte []  bytFileStream,
string  templateName 
)
inline

Decodes barcodes from an image file in memory.

Parameters
bytFileStreamThe image file bytes in memory.
templateNameThe template name.
Returns
All barcode text results decoded successfully.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

◆ GetAllLocalizationResults()

LocalizationResult [] Dynamsoft.Barcode.BarcodeReader.GetAllLocalizationResults ( )
inline

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

Returns
All barcode localization results obtained by the last called function DecodeFile/DecodeFileInMemory/DecodeBuffer/DecodeBase64String/DecodeBitmap.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

◆ GetAllParameterTemplateNames()

string [] Dynamsoft.Barcode.BarcodeReader.GetAllParameterTemplateNames ( )
inline

Gets the parameter templates name array.

Returns
The template name array.

◆ GetRuntimeSettings()

PublicRuntimeSettings Dynamsoft.Barcode.BarcodeReader.GetRuntimeSettings ( )
inline

Gets current settings and save it into a struct.

Returns
The struct of template settings.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

◆ GetTemplateSettings()

PublicParameterSettings Dynamsoft.Barcode.BarcodeReader.GetTemplateSettings ( string  strImageTemplateName)
inline

Ensure compatibility with earlier versions. It is functionally equivalent to GetRuntimeSettings.

Parameters
strImageTemplateNameThe template name.
Returns
The struct of template settings.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.


Deprecated:
GetTemplateSettings
See also
GetRuntimeSettings

◆ InitRuntimeSettingsWithFile()

EnumErrorCode Dynamsoft.Barcode.BarcodeReader.InitRuntimeSettingsWithFile ( string  jsonFileName,
EnumConflictMode  emSettingPriority,
out string  errorMessage 
)
inline

Initialize runtime settings with the settings in given JSON file.

Parameters
jsonFileNameThe path of the settings file.
emSettingPriorityThe parameter setting mode, which decides to inherit parameters from previous template setting or overwrite previous settings and replace by new template.
errorMessageOutput parameter storing detailed error message.
Returns
Returns error code.

◆ InitRuntimeSettingsWithString()

EnumErrorCode Dynamsoft.Barcode.BarcodeReader.InitRuntimeSettingsWithString ( string  jsonContent,
EnumConflictMode  emSettingPriority,
out string  errorMessage 
)
inline

Initialize runtime settings with the settings in given JSON string.

Parameters
jsonContentA JSON string that represents the content of the settings.
emSettingPriorityThe parameter setting mode, which decides to inherit parameters from previous template setting or overwrite previous settings and replace by new template.
errorMessageOutput parameter storing detailed error message.
Returns
Returns error code.

◆ LoadSettings()

void Dynamsoft.Barcode.BarcodeReader.LoadSettings ( string  jsonContent)
inline

Ensure compatibility with earlier versions. It is functionally equivalent to InitRuntimeSettingsWithString with conflict mode ECM_Overwrite as default.

Parameters
jsonContentA JSON string that represents the content of the settings.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.


Deprecated:
LoadSettings
See also
InitRuntimeSettingsWithString

◆ LoadSettingsFromFile()

void Dynamsoft.Barcode.BarcodeReader.LoadSettingsFromFile ( string  jsonFileName)
inline

Ensure compatibility with earlier versions. It is functionally equivalent to InitRuntimeSettingsWithFile with conflict mode ECM_Overwrite as default.

Parameters
jsonFileNameThe path of the settings file.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.


Deprecated:
LoadSettingsFromFile
See also
InitRuntimeSettingsWithFile

◆ OutputSettingsToFile()

void Dynamsoft.Barcode.BarcodeReader.OutputSettingsToFile ( string  outputFilePath,
string  settingsName 
)
inline

Outputs runtime settings and save it into a settings file (JSON file).

Parameters
outputFilePathThe output file path which stores current settings.
settingsNameA unique name for declaring current runtime settings.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

◆ OutputSettingsToString()

string Dynamsoft.Barcode.BarcodeReader.OutputSettingsToString ( string  settingsName)
inline

Outputs runtime settings to a string.

Parameters
settingsNameA unique name for declaring current runtime settings.
Returns
The output string which stores the contents of current settings.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

◆ ResetRuntimeSettings()

void Dynamsoft.Barcode.BarcodeReader.ResetRuntimeSettings ( )
inline

Resets all parameters to default values.

◆ SetTemplateSettings()

void Dynamsoft.Barcode.BarcodeReader.SetTemplateSettings ( PublicParameterSettings  settings)
inline

Ensure compatibility with earlier versions. It is functionally equivalent to UpdateRuntimeSettings.

Parameters
settingsThe struct of template settings.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.


Deprecated:
SetTemplateSettings
See also
UpdateRuntimeSettings

◆ UpdateRuntimeSettings()

void Dynamsoft.Barcode.BarcodeReader.UpdateRuntimeSettings ( PublicRuntimeSettings  settings)
inline

Update runtime settings with a given struct.

Parameters
settingsThe struct of template settings.
Exceptions
BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

Property Documentation

◆ LicenseKeys

string Dynamsoft.Barcode.BarcodeReader.LicenseKeys
getset

License key used for Dynamsoft Barcode Reader.