Deprecation warning

Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.

We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.

You'll find the updated documentation at: Data Capture SDK Documentation for Xamarin.Android and Data Capture SDK Documentation for Xamarin.iOS

ScanSettings Interface Reference

Public Member Functions

ScanSettings DefaultSettings ()
 
ScanSettings Pre47DefaultSettings ()
 
ScanSettings SettingsFromDictionary (NSDictionary dict, NSError error)
 
void EnableSymbologies (NSSet symbologies)
 
void SetSymbologyEnabled (Symbology symbology, bool enabled)
 
NSSet EnabledSymbologies ()
 
SymbologySettings SettingsForSymbology (Symbology symbology)
 
void SetActiveScanningArea (CGRect area)
 
void SetProperty (String property, int value)
 

Properties

bool Force2dRecognition [get, set]
 
int MaxNumberOfCodesPerFrame [get, set]
 
int CodeDuplicateFilter [get, set]
 
int CodeCachingDuration [get, set]
 
float RelativeZoom [get, set]
 
CameraFacingDirection CameraFacingDirection [get, set]
 
String DeviceName [get, set]
 
bool HighDensityModeEnabled [get, set]
 
CGRect ActiveScanningAreaLandscape [get, set]
 
CGRect ActiveScanningAreaPortrait [get, set]
 
bool RestrictedAreaScanningEnabled [get, set]
 
CGPoint ScanningHotSpot [get, set]
 
bool MotionCompensationEnabled [get, set]
 
bool CodeRejectionEnabled [get, set]
 
TextRecognitionSettings TextRecognitionSettings [get, set]
 
RecognitionMode RecognitionMode [get, set]
 
bool MatrixScanEnabled [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.7 to hold all scan-specific settings. The settings are passed to the BarcodePicker when it is constructed.

Scan settings are not directly allocated, instead you should use one of the factory settings (defaultSettings or pre47DefaultSettings) to receive a settings instance.

Since
4.7.0

Member Function Documentation

ScanSettings DefaultSettings ( )

Settings object with default values.

Returns
new settings object
ScanSettings Pre47DefaultSettings ( )

Convenience method to retrieve default settings as they were before ScanditSDK 4.7.

This method will return a settings object with symbologies on that were on by default for ScanditSDK 4.6 and older. These symbologies include EAN13, UPC12, EAN8, UPCE, CODE39, ITF, CODE128, QR, DATAMATRIX.

The use of this method is discouraged. Use defaultSettings instead and explicitly enable the symbologies that are required by your app.

Returns
new settings object
ScanSettings SettingsFromDictionary ( NSDictionary  dict,
NSError  error 
)

Returns a settings instance initialized with the values contained in dict.

Parameters
dictDictionary, e.g. as deserialized from JSON to use for initializing the settings.
errorUpon failure, will contain further details on why the settings instance could not be created.
Returns
new settings object
void EnableSymbologies ( NSSet  symbologies)

Enable decoding of the given symbologies.

This function provides a convenient shortcut to enabling/disabling decoding of a particular symbology without having to go through SymbologySettings.

By default, all symbologies are turned off and symbologies need to be explicitly enabled.

Parameters
symbologiesThe symbologies that should be enabled.
Since
4.7.0
void SetSymbologyEnabled ( Symbology  symbology,
bool  enabled 
)

Enable/disable decoding of a certain symbology.

This function provides a convenient shortcut to enabling/disabling decoding of a particular symbology without having to go through SymbologySettings.

Parameters
symbologyThe symbology to be enabled.
enabledtrue when decoding of the symbology should be enabled, false if not.
Since
4.7.0
NSSet EnabledSymbologies ( )

Returns the set of enabled symbologies.

Returns
A set of all symbologies that are currently enabled.
SymbologySettings SettingsForSymbology ( Symbology  symbology)

Retrieve symbology-specific settings.

Parameters
symbologyThe symbology for which to retrieve the settings.
Returns
The symbology-specific settings object.
Since
4.7.0
void SetActiveScanningArea ( CGRect  area)

Convenience function to set the landscape and portrait active scanning area.

Use this method to set ActiveScanningAreaLandscape and ActiveScanningAreaPortrait to the same value.

Parameters
areaThe active scanning area as a CGRect.
Since
4.7.0
void SetProperty ( String  property,
int  value 
)

Set a custom property to configure the scanner.

Use this method to set scan settings that are not part of the public API yet. There are no stability guarantees for these properties and they might get renamed, or disappear completely in future releases. Setting properties that no longer exist is not an error, but they will be ignored.

Parameters
propertyThe name of the property to set. Must not be nil.
valueThe value to set the property to.
Since
4.10

Property Documentation

bool Force2dRecognition
getset

Forces the barcode scanner to always run the 2D decoders (QR, Datamatrix, etc.), even when the 2D detector did not detect the presence of a 2D code.

This slows down the overall scanning speed, but can be useful when your application only tries to read 2D codes. Force 2d recognition is set to on when micro data matrix mode is enabled.

By default forced 2d recognition is disabled.

int MaxNumberOfCodesPerFrame
getset

The maximum number of barcodes to be decoded every frame.

If set to values smaller than 1, a minimum of 1 is enforced. Note that settings the maximum number of codes per frame to high values can have negative impact on scanning performance.

Since
4.7.0
int CodeDuplicateFilter
getset

Specifies the duplicate filter to use for the session.

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 500ms.

Since
4.7.0
int CodeCachingDuration
getset

Determines how long codes are kept in the session.

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

The default value is -1.

Since
4.7.0
float RelativeZoom
getset

The zoom as a percentage of the max zoom possible (between 0 and 1).

The preferred camera direction.

The picker first gives preference to cameras of the given direction. When the device has no such camera, cameras of the opposite face are tried as well.

By default, the back-facing camera is preferred.

Since
4.7.0
String DeviceName
getset

The device name to identify the current device when looking at analytics tools.

Sends a request to the server to set this as soon as a connection is available.

Since
4.7.0
bool HighDensityModeEnabled
getset

High density mode enables phones to work at higher camera resolution, provided they support it.

When enabled, phones that are able to run the video preview at 1080p (1920x1080) will use 1080p and not just 720p (1280x720). High density mode gives better decode ranges at the expense of processing speed and allows to decode smaller code in the near range, or codes that further away.

By default, high density mode is disabled.

Since
4.7.0
CGRect 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 when the picker is in landscape orientation. By default, this area is set to the full camera preview.

The rectangle is defined in relative view coordinates, where the top-left corner is (0,0) and the bottom right corner of the view is (1,1).

Since
4.7.0
CGRect 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 when the picker is in portrait orientation. By default, this area is set to the full camera preview.

When setting this property, restricted area scanning (restrictedAreaScanningEnabled) is automatically set to true.

The rectangle is defined in relative view coordinates, where the top-left corner is (0,0) and the bottom right corner of the view is (1,1).

Since
4.7.0
bool RestrictedAreaScanningEnabled
getset
Since
4.7.0

When set to true, barcode recognition is restricted to the rectangles defined by activeScanningAreaPortrait and activeScanningAreaLandscape, depending on the orientation of the phone. When false, the whole image is searched for barcodes.

CGPoint 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 of the view is (1,1).

The default values is (0.5, 0.5).

Since
4.7.0
bool MotionCompensationEnabled
getset

Enable/disable motion compensation.

When motion compensation is enabled, special algorithms are run to improve the image quality when the phone or the barcode to be scanned are moving. Motion compensation requires an OpenGLES 3.0 compatible device. For devices that do not support OpenGLES 3.0, setting the motion compensation flag has no effect.

Motion compensation is enabled by default.

Since
4.7.0
bool CodeRejectionEnabled
getset

Whether code rejection should be enabled.

Code rejection allows you to implement custom code verification features and reject certain codes by calling ScanSession.RejectCode:. By default, code rejection is disabled.

Since
4.16

The text recognition settings to be used.

By default, the text recognition settings are set to nil. If you want to use the text recognition feature, you must set this property and configure the settings accordingly.

This feature is only available if you have text recognition enabled.

Since
5.1

The recognition mode to use for the barcode picker.

Use this property to programmatically switch between text and barcode recognition. By default, barcode recognition is on (RecognitionMode.Code).

Since
5.1
bool MatrixScanEnabled
getset

Whether matrix scan should be enabled.

Matrix scan allows you to know the location of all localized codes. In order to get the tracked codes, it is recommended to implement the SBSProcessFrameDelegate protocol and to use SBSScanSession::trackedCodes. To use the default matrix scan UI, it is necessary to set SBSOverlayController::guiStyle to SBSGuiStyle::MatrixScan. When implementing a custom matrix scan UI, it is recommended to set SBSOverlayController::guiStyle to SBSGuiStyle::None.

Since
5.2