ScanSettings Class Reference

Public Member Functions

int GetProperty (string key)
 
void SetProperty (string key, int value)
 
void EnableSymbology (Symbology symbology, bool enabled=true)
 

Properties

int CodeCachingDuration [get, set]
 
int CodeDuplicateFilter [get, set]
 
uint MaxNumberOfCodesPerFrame [get, set]
 
bool RestrictedAreaScanningEnabled [get, set]
 
CameraPosition CameraPositionPreference [get, set]
 
Point ScanningHotSpot [get, set]
 
IReadOnlyDictionary< Symbology, SymbologySettingsSymbologies [get]
 
VideoResolution ResolutionPreference [get, set]
 
Rect ActiveScanningAreaPortrait [get, set]
 
Rect ActiveScanningAreaLandscape [get, set]
 
Boolean CodeRejectionEnabled [get, set]
 

Detailed Description

Holds settings that affect the recognition of barcodes, such as enabled barcode symbologies, scanning hot spot etc.

The ScanSettings class was introduced in ScanditSDK 4.10 to hold all scan-specific settings. The settings are passed to the BarcodePicker when it is constructed, or applied through IBarcodePicker.ApplySettingsAsync.

Member Function Documentation

int GetProperty ( string  key)

Get custom property previously set on the scanner settings.

Custom properties are used for features of the barcode scanner that are not yet part of the public API. As such they can disappear in one of the next releases or change meaning. Use with caution.

Only properties of previous calls to SetProperty are returned here.

Parameters
keyThe parameter name.
Returns
The value of the property. Will return -1 for properties that are not defined.
void SetProperty ( string  key,
int  value 
)

Set custom property

GetProperty

Parameters
keyThe parameter name.
valueThe parameter value
void EnableSymbology ( Symbology  symbology,
bool  enabled = true 
)

Enable or disable recognition of particular symbology

By default, recognition of all symbologies is disabled. Each required symbology must be explicitly enabled. It is recommended to only enable symbologies actually used by the application, as each enabled symbology consumes a certain amount of processing time.

Some 1d barcode symbologies allow you to encode variable-length data. By default, the Scandit BarcodeScanner SDK only scans barcodes in a certain length range. If your application requires scanning of one of these symbologies, and the length is falling outside the default range, you may need to adjust the "active symbol counts" for this symbology. This is shown in the following few lines of code.

var activeSymbolCounts = Enumerable.Range(7, 14).Select(x => (UInt16)x).ToList();
settings.Symbologies[Symbology.Code39].ActiveSymbolCounts = activeSymbolCounts;

For details on defaults and how to calculate the symbol counts for each symbology, take a look at the symbologies properties page.

Parameters
symbologyThe symbology to enable/disable. Must not be Symbology.Unknown
enabledWhether the symbology should be enabled.

Property Documentation

int CodeCachingDuration
getset

Get the code caching duration of the scan session.

When set to -1, codes are kept until the next call to ScanSession.Clear. When set to 0, codes are kept until the next frame processing call finishes. For all other values, the code caching duration specifies a duration in milliseconds for how long the codes are kept.

The default value is -1.

int CodeDuplicateFilter
getset

The code duplicate filter to be used

Duplicate filtering affects the handling of codes with the same data and symbology. When the filter is set to -1, each unique code is only added once to the session, when set to 0, duplicate filtering is disabled. Otherwise the duplicate filter specifies an interval in milliseconds. When the same code (data/symbology) is scanned withing the specified interval is it filtered out as a duplicate. The default value is 500.

uint MaxNumberOfCodesPerFrame
getset

The maximum number of codes to be decoded every frame.

Tells the recognition engine how many codes should maximally decoded per frame. When set to values higher than 1 barcode, the barcode recognition engine tries to decode additional codes, even if codes were already recognized.

If set to values smaller than 1, a minimum of 1 code per frame is enforced.

bool RestrictedAreaScanningEnabled
getset

Whether barcode/2d code recognition should be restricted to a certain area.

By default, barcodes and 2d codes are searched in the whole image. When this property is true, the recognition of barcodes is restricted to the area defined by either ActiveScanningAreaPortrait, or ActiveScanningAreaLandscape, depending on the orientation of the device.

CameraPosition CameraPositionPreference
getset

Gets or sets the camera position preference.

The camera position preference allows to choose whether the front or back camera should be given preference, if the device has multiple cameras. In case the camera does not have a camera at the desired position, the first camera of the device is chosen.

Point ScanningHotSpot
getset

Defines the point at which barcodes and 2d codes are expected.

The hot spot is defined in relative view coordinates, where the top-left corner is (0,0) and the bottom-right corner is (1,1). The default value is (0.5, 0.5).

IReadOnlyDictionary<Symbology, SymbologySettings> Symbologies
get

Map of symbology-specific settings

The dictionary holds a separate settings object for each supported symbology. These settings allow to control optional checksums, code-lengths as well as custom extensions that can be enabled or disabled for each symbology separately.

VideoResolution ResolutionPreference
getset

The target resolution to use for the video stream.

By default, the video stream uses a medium resolution for preview as well as barcode identification. Use this property to switch to a higher resolution for scanning and preview. Using higher resolutions increases scan performance but comes at the cost of increased CPU-usage.

Rect ActiveScanningAreaPortrait
getset

The active scanning area when the picker is in portrait orientation

The active scanning area defines the rectangle in which barcodes and 2d codes are searched and decoded. By default, this area is set to the full image. The rectangle is defined in relative view coordinates, where the top-left corner is (0,0) and the bottom right corner is (1,1). When you set this property, RestrictedAreaScanningEnabled is automatically set to true.

Rect ActiveScanningAreaLandscape
getset

The active scanning area when the picker is in landscape orientation

The active scanning area defines the rectangle in which barcodes and 2d codes are searched and decoded. By default, this area is set to the full image. The rectangle is defined in relative view coordinates, where the top-left corner is (0,0) and the bottom right corner is (1,1). When you set this property, RestrictedAreaScanningEnabled is automatically set to true.

Boolean CodeRejectionEnabled
getset

Whether code rejection should be enabled

Code rejection allows you to implement custom validation steps for recognized codes. By default code rejection is disabled.