.Net API Reference - Settings
Method | Description |
---|---|
AppendSettingsFromFile |
Appends LabelRecognitionParameter settings in a file to the SDK object. |
AppendSettingsFromString |
Appends LabelRecognitionParameter settings in a string to the SDK object. |
ClearAppendedSettings |
Clears appended LabelRecognitionParameter settings. |
GetModeArgument |
Get argument value for the specified mode parameter. |
GetRuntimeSettings |
Gets the current settings and saves it into a class object. |
OutputSettingsToFile |
Outputs LabelRecognitionParameter settings into a file (JSON file). |
ResetRuntimeSettings |
Resets the runtime settings. |
SetModeArgument |
Set argument value for the specified mode parameter. |
UpdateReferenceRegionFromBarcodeResults |
Updates reference region which is defined with source type DLR_LST_BARCODE. |
UpdateRuntimeSettings |
Updates runtime settings with a given class object. |
GetRuntimeSettings
Get current settings and save them into a DLR_RuntimeSettings
class object.
PublicRuntimeSettings Dynamsoft.DLR.LabelRecognition.GetRuntimeSettings ()
Return Value
The class object of runtime settings.
Exceptions
DLR_Exception
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
DLR_RuntimeSettings settings = recognizer.GetRuntimeSettings();
recognizer.Dispose();
UpdateRuntimeSettings
Update runtime settings with a given DLR_RuntimeSettings
class object.
void Dynamsoft.DLR.LabelRecognition.UpdateRuntimeSettings (DLR_RuntimeSettings settings)
Parameters
settings
The class object of runtime settings.
Exceptions
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
DLR_RuntimeSettings settings = recognizer.GetRuntimeSettings();
settings.linesCount = 1;
recognizer.UpdateRuntimeSettings(settings);
recognizer.Dispose();
ResetRuntimeSettings
Reset all runtime settings to default values.
void Dynamsoft.DLR.LabelRecognition.ResetRuntimeSettings ()
Exceptions
DLR_Exception
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
DLR_RuntimeSettings settings = recognizer.GetRuntimeSettings();
settings.linesCount = 1;
recognizer.UpdateRuntimeSettings(settings);
recognizer.ResetRuntimeSettings();
recognizer.Dispose();
AppendSettingsFromString
Append a new template string to the current label recognition instance.
void Dynamsoft.DLR.LabelRecognition.AppendSettingsFromString (string content)
Parameters
content
A JSON string that represents the content of the settings.
Exceptions
DLR_Exception
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
recognizer.AppendSettingsFromString("{\"LabelRecognitionParameter\":{\"Name\":\"P1\", \"RegionPredetectionModes\":[{\"Mode\":\"DLR_RPM_GENERAL_HSV_CONTRAST\"}], \"ReferenceRegionNameArray\": [\"R1\"]},\"ReferenceRegion\":{\"Name\":\"R1\",\"Localization\":{\"SourceType\":\"DLR_LST_PREDETECTED_REGION\",\"RegionPredetectionModesIndex\":0},\"TextAreaNameArray\":[\"T1\"]},\"TextArea\":{\"Name\":\"T1\",\"CharacterModelName\":\"Number\"}}");
recognizer.Dispose();
AppendSettingsFromFile
Appends LabelRecognitionParameter settings in a file to the SDK object.
void Dynamsoft.DLR.LabelRecognition.AppendSettingsFromFile (string filePath)
Parameters
filePath
The settings file path.
Exceptions
DLR_Exception
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
recognizer.AppendSettingsFromFile("your file path");
recognizer.Dispose();
OutputSettingsToFile
Outputs runtime settings and save them into a settings file (JSON file).
void Dynamsoft.DLR.LabelRecognition.OutputSettingsToFile (string filePath, string templateName)
Parameters
filePath
The path of the output file which stores current settings.
templateName
A unique name for declaring current runtime settings.
Exceptions
DLR_Exception
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
recognizer.AppendSettingsFromString("{\"LabelRecognitionParameter\":{\"Name\":\"P1\", \"RegionPredetectionModes\":[{\"Mode\":\"DLR_RPM_GENERAL_HSV_CONTRAST\"}], \"ReferenceRegionNameArray\": [\"R1\"]},\"ReferenceRegion\":{\"Name\":\"R1\",\"Localization\":{\"SourceType\":\"DLR_LST_PREDETECTED_REGION\",\"RegionPredetectionModesIndex\":0},\"TextAreaNameArray\":[\"T1\"]},\"TextArea\":{\"Name\":\"T1\",\"CharacterModelName\":\"Number\"}}");
recognizer.OutputSettingsToFile("your saving file path", "currentRuntimeSettings");
recognizer.Dispose();
ClearAppendedSettings
Clear all appended parameter settings of the current label recognition instance.
void Dynamsoft.DLR.LabelRecognition.ClearAppendedSettings ()
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
recognizer.ClearAppendedSettings();
UpdateReferenceRegionFromBarcodeResults
Updates reference region which is defined with source type DLR_LST_BARCODE.
void Dynamsoft.DLR.LabelRecognition.UpdateReferenceRegionFromBarcodeResults (TextResult[] barcodeResults, string templateName)
Parameters
barcodeResults
The barcode results used to localize reference region.
templateName
The template name. A template name is the value of key LabelRecognitionParameter.Name defined in JSON formatted settings. If no template name is specified, current runtime settings will be used.
Exceptions
DLR_Exception
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
recognizer.AppendSettingsFromString("{\"LabelRecognitionParameter\":{\"Name\":\"P1\", \"RegionPredetectionModes\":[{\"Mode\":\"DLR_RPM_GENERAL_HSV_CONTRAST\"}], \"ReferenceRegionNameArray\": [\"R1\"]},\"ReferenceRegion\":{\"Name\":\"R1\",\"Localization\":{\"SourceType\":\"DLR_LST_BARCODE\"},\"TextAreaNameArray\":[\"T1\"]},\"TextArea\":{\"Name\":\"T1\",\"CharacterModelName\":\"Number\"}}");
//Get barcodeResults from Dynamsoft Barcode Reader SDK
recognizer.UpdateReferenceRegionFromBarcodeResults(barcodeResults, "P1");
recognizer.Dispose();
SetModeArgument
Set argument value for the specified mode parameter.
void Dynamsoft.DLR.LabelRecognition.SetModeArgument (string modesName, int index, string argumentName, string argumentValue)
Parameters
modesName
: The mode parameter name to set argument.index
: The array index of mode parameter to indicate a specific mode.argumentName
: The name of the argument to set.argumentValue
: The value of the argument to set.
Exceptions
DLR_Exception
Remark
Check follow link for available modes and arguments:
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
DLR_RuntimeSettings settings = recognizer.GetRuntimeSettings();
settings.regionPredetectionModes[0] = EnumRegionPredetectionMode.DLR_RPM_GENERAL_RGB_CONTRAST;
recognizer.UpdateRuntimeSettings(settings);
recognizer.SetModeArgument("RegionPredetectionModes", 0, "AspectRatioRange", "100");
recognizer.Dispose();
GetModeArgument
Get argument value for the specified mode parameter.
string Dynamsoft.DLR.LabelRecognition.GetModeArgument (string modesName, int index, string argumentName)
Parameters
modesName
: The mode parameter name to get argument.index
: The array index of mode parameter to indicate a specific mode.argumentName
: The name of the argument to get.
Return Value the optional argument for a specified mode in Modes parameters.
Exceptions
DLR_Exception
Remark
Check follow link for available modes and arguments:
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
recognizer.InitLicense("t0260NwAAAHV***************");
DLR_RuntimeSettings settings = recognizer.GetRuntimeSettings();
settings.regionPredetectionModes[0] = EnumRegionPredetectionMode.DLR_RPM_GENERAL_RGB_CONTRAST;
recognizer.UpdateRuntimeSettings(settings);
recognizer.SetModeArgument("RegionPredetectionModes", 0, "AspectRatioRange", "100");
string argumentValue = recognizer.GetModeArgument("RegionPredetectionModes", 0, "AspectRatioRange");
recognizer.Dispose();