←Select platform

SetEnumValue(string,int) Method

Summary
Sets the value of an enum setting from an integer.
Syntax
C#
VB
Objective-C
C++
Java
public void SetEnumValue( 
   string settingName, 
   int value 
) 
Overloads Sub SetEnumValue( _ 
   ByVal settingName As String, _ 
   ByVal value As Integer _ 
)  
- (void)setEnumValue:(NSInteger)value 
          forSetting:(NSString *)settingName 
public void setEnumValue(String settingName, 
                         int value) 
void SetEnumValue(  
   String^ settingName, 
   int value 
)  

Parameters

settingName
Unique setting name. If the IOcrEngine does not support the setting with the unique name settingName, an exception will be thrown. You can check which settings the engine supports by using GetSettingNames or IsSettingNameSupported.

value
The new setting value as an integer.

Remarks

The settingName setting must be an "enum" type setting, otherwise; this method will throw an exception. To get the type of a setting along with other information such as its friendly name and range use the GetSettingDescriptor method.

This method sets the value as an integer, if the enum is not a flag enum type (the value of IOcrSettingDescriptor.EnumIsFlags of the IOcrSettingDescriptor for this setting is false), then the integer value of the setting is the integer value of the enum member.

If the enum is a flag enum type (the value of IOcrSettingDescriptor.EnumIsFlags of the IOcrSettingDescriptor for this setting is true), then the integer value of the setting is the sum of the OR'ed flagged set.

The enum member values and their friendly names can be obtained with IOcrSettingDescriptor.GetEnumMemberValues and IOcrSettingDescriptor.GetEnumMemberFriendlyNames.

To get the value of an enum setting as integer, use GetEnumValue.

To get or set the enum value from a string value, use GetEnumValueAsString or SetEnumValue.

You can also set the value of any setting from a string (where the string will be converted to a compatible type) using SetValue. To get the value of any setting as a string, use GetValue Note that settings of type OcrSettingValueType.BeginCategory and OcrSettingValueType.EndCategory have no values and will throw an exception if you try to get or set their values.

IOcrEngine is a wrapper for different OCR engines. These engines contain specific additional features and functionalities that can be queried and updated using the IOcrSettingManager interface.

You can use the different methods of the IOcrSettingManager interface to get and set the engine-specific settings. Each setting has a unique name (a string value). You can get all the settings available to the current OCR engine through the GetSettingNames method. The GetSettingDescriptor method returns a description of the setting (its type, friendly name and value range), you can then use the various setting get and set methods to query and change the value of a certain setting. For example, if the setting type is OcrSettingValueType.Integer, you can use the GetIntegerValue to get the current value of the setting and the SetIntegerValue to change its value. Refer to IOcrSettingManager for a complete example.

For a list of supported engine-specific settings and their meanings, refer to OCR engine-specific Settings.

Example

For an example, refer to IOcrSettingManager.

Requirements

Target Platforms

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Ocr Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.