Resource Base
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

Parameter and Runtime Settings Basic Methods

Method Description
getRuntimeSettings Get current runtime settings.
updateRuntimeSettings (with Struct) Update runtime settings with a given struct.
updateRuntimeSettings (with preset template)) Update runtime settings from one of the preset templates.
resetRuntimeSettings Resets all parameters to default values.
setModeArgument Sets the optional argument for a specified mode in Modes parameters.
getModeArgument Gets the optional argument for a specified mode in Modes parameters.

getRuntimeSettings

Get current settings and save them into a iPublicRuntimeSettings struct.

- (iPublicRuntimeSettings* _Nullable)getRuntimeSettings:(NSError* _Nullable * _Nullable)error;

Parameters

[in, out] error Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

Return Value

A DBRPublicRuntimeSettings storing current runtime settings.

Code Snippet

Objective-C:

NSError __autoreleasing * _Nullable error;
[barcodeReader getRuntimeSettings:&error];

Swift:

let error: NSError? = NSError()
let licenseString = barcodeReader.getRuntimeSettings(error: &error)

updateRuntimeSettings

With a PublicRuntimeSettings Struct

Update runtime settings with a given iPublicRuntimeSettings struct.

- (void)updateRuntimeSettings:(iPublicRuntimeSettings* _Nonnull)settings
                        error:(NSError* _Nullable * _Nullable)error;

Parameters

[in] settings The struct of template settings.
[in,out] error Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

Code Snippet

Objective-C:

NSError __autoreleasing * _Nullable error;
iPublicRuntimeSettings *settings;

[barcodeReader updateRuntimeSettings:settings error:&error];

Swift:

let error: NSError? = NSError()
let settings = barcodeReader.getRuntimeSettings(error: nil)
barcodeReader.updateRuntimeSettings(settings: settings, error: &error)

With a Preset Template

- (void)updateRuntimeSettings:(EnumPresetTemplate)presetTemplate;

Parameters

presetTemplate: One of the preset templates.

Code Snippet

Objective-C:

[barcodeReader updateRuntimeSettings:EnumPresetTemplate.EnumPresetTemplateVideoSingleBarcode];

Swift:

barcodeReader.updateRuntimeSettings(EnumPresetTemplate.EnumPresetTemplateVideoSingleBarcode)

resetRuntimeSettings

Reset all parameters to default values.

- (void)resetRuntimeSettings:(NSError* _Nullable * _Nullable)error;

Parameters

[in,out] error Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

Code Snippet

Objective-C:

NSError __autoreleasing * _Nullable error;
[barcodeReader resetRuntimeSettings:&error];

Swift:

let error: NSError? = NSError()
barcodeReader.resetRuntimeSettings(error: &error)

setModeArgument

Sets the optional argument for a specified mode in Modes parameters.

-(void)setModeArgument:(NSString* _Nonnull)modeName
                    index:(NSInteger)index 
                    argumentName:(NSString* _Nonnull)argumentName
                    argumentValue:(NSString* _Nonnull)argumentValue
                    error:(NSError* _Nullable * _Nullable)error;

Parameters

[in] modesName The mode parameter name to set argument.
[in] index The array index of mode parameter to indicate a specific mode.
[in] argumentName The name of the argument to set.
[in] argumentValue The value of the argument to set.
[in,out] error Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

Code Snippet

Objective-C:

DynamsoftBarcodeReader *barcodeReader;
iPublicRuntimeSettings *settings;
NSError __autoreleasing * _Nullable error;
NSMutableArray *mArray = [NSMutableArray arrayWithArray:settings.binarizationModes];
mArray[0] = [NSNumber numberWithInteger:EnumBinarizationModeLocalBlock];
settings.binarizationModes = mArray;

[barcodeReader updateRuntimeSettings:settings error:&error];
[barcodeReader setModeArgument:@"BinarizationModes" index:0 argumentName:@"EnableFillBinaryVacancy" argumentValue:"1" error:&error];

Swift:

let error: NSError? = NSError()
let mArray: NSMutableArray? = NSMutableArray()
let settings = barcodeReader.getRuntimeSettings(error: nil)
mArray!.setArray(settings.binarizationModes as! [Any])
mArray![0] = EnumBinarizationMode.LocalBlock
settings.binarizationModes = mArray!
barcodeReader.update(settings: settings, error: nil)
barcodeReader.setModeArgument(modeName: "BinarizationModes", index: 0, argumentName: "EnableFillBinaryVacancy", argumentValue: "1", error: &error)

Remarks

Check follow link for available modes and arguments:

getModeArgument

Gets the optional argument for a specified mode in Modes parameters.

-(NSString* _Nonnull)getModeArgument:(NSString* _Nonnull)modeName
                            index:(NSInteger)index
                            argumentName:(NSString* _Nonnull)argumentName
                            error:(NSError* _Nullable * _Nullable)error;

Parameters

[in] modesName The mode parameter name to get argument.
[in] index The array index of mode parameter to indicate a specific mode.
[in] argumentName The name of the argument to get.
[in,out] error Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

Return Value

the optional argument for a specified mode

Code Snippet

Objective-C:

iPublicRuntimeSettings *settings;
NSError __autoreleasing * _Nullable error;
NSString *argumentValue;
NSMutableArray *mArray = [NSMutableArray arrayWithArray:settings.binarizationModes];
mArray[0] = [NSNumber numberWithInteger:EnumBinarizationModeLocalBlock];
settings.binarizationModes = mArray;

[barcodeReader updateRuntimeSettings:settings error:&error];
[barcodeReader setModeArgument:@"BinarizationModes" index:0 argumentName:@"EnableFillBinaryVacancy" argumentValue:"1" error:&error];
argumentValue = [barcodeReader getModeArgument:@"BinarizationModes" index:0 argumentName:@"EnableFillBinaryVacancy" error:&error];

Swift:

let error: NSError? = NSError()
let mArray: NSMutableArray? = NSMutableArray()
let settings = barcodeReader.getRuntimeSettings(error: nil)
mArray!.setArray(settings.binarizationModes as! [Any])
mArray![0] = EnumBinarizationMode.LocalBlock
settings.binarizationModes = mArray!
barcodeReader.update(settings: settings, error: nil)
barcodeReader.setModeArgument(modeName: "BinarizationModes", index: 0, argumentName: "EnableFillBinaryVacancy", argumentValue: "1", error: nil)
let argumentValue = barcodeReader.getModeArgument(modeName: "BinarizationModes", index: 0, argumentName: "EnableFillBinaryVacancy", error: &error)

Remarks

Check follow link for available modes and arguments:

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 8.9.0
  • Version 8.8.0
  • Version 8.6.3
  • Version 8.6.1
  • Version 8.6.0
  • Version 8.4.0
  • Version 8.2.5
  • Version 8.2.3
  • Version 8.2.1
  • Version 8.2.0
  • Version 8.1.3
  • Version 8.1.2
  • Version 8.1.0
  • Version 8.0.0
  • Version 7.6.0
  • Version 7.5.0
Change +
© 2003–2022 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support