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

ScanOverlay Interface Reference

Public Member Functions

void SetMatrixScanHighlightingColor (MatrixScanHighlightingState state, int color)
 

Properties

UIToolbar ToolBar [get]
 
NSObject WeakCancelDelegate [get, set]
 
GuiStyle GuiStyle [get, set]
 

Sound Configuration

Customize the scan sound.

void SetBeepEnabled (bool enabled)
 
void SetVibrateEnabled (bool enabled)
 
bool SetScanSoundResource (String path, String extension)
 

Torch Configuration

Enable and customize appearance of the torch icon.

void SetTorchEnabled (bool enabled)
 
bool SetTorchOnImage (UIImage image, UIImage pressedImage)
 
bool SetTorchOnImageResource (String fileName, String pressedFileName, String extension)
 
bool SetTorchOffImage (UIImage image, UIImage pressedImage)
 
bool SetTorchOffImageResource (String fileName, String pressedFileName, String extension)
 
void SetTorchButtonMarginsAndSize (float leftMargin, float topMargin, float width, float height)
 
void SetTorchOffAccessibilityLabel (String label, String hint)
 
void SetTorchOnButtonAccessibilityLabel (String label, String hint)
 

Camera Switch Configuration

Enable camera switch and set icons

void SetCameraSwitchVisibility (CameraSwitchVisibility visibility)
 
bool SetCameraSwitchImage (UIImage image, UIImage pressedImage)
 
bool SetCameraSwitchImageResource (String fileName, String pressedFileName, String extension)
 
void SetCameraSwitchButtonMarginsAndSize (float rightMargin, float topMargin, float width, float height)
 
void SetCameraSwitchButtonBackAccessibilityLabel (String label, String hint)
 
void SetCameraSwitchButtonFrontAccessibilityLabel (String label, String hint)
 

Viewfinder Configuration

Customize the viewfinder where the barcode location is highlighted.

void SetViewfinderDimension (float height, float width, float landscapeHeight, float landscapeWidth)
 
void SetViewfinderPortraitDimension (float width, float height)
 
void SetViewfinderLandscapeDimension (float width, float height)
 
void SetViewfinderColor (float red, float green, float blue)
 
void SetViewfinderDecodedColor (float red, float green, float blue)
 
void ResetUI ()
 

Toolbar Configuration

Customize toolbar appearance

void ShowToolBar (bool show)
 
void SetToolBarButtonCaption (String caption)
 

Camera Permission Configuration

Customize the text shown if the camera can not be aquired.

void SetMissingCameraPermissionInfoText (String infoText)
 

Detailed Description

controls the scan screen user interface.

The overlay controller can be used to configure various scan screen UI elements such as toolbar, torch, camera switch icon, scandit logo and the viewfinder.

Developers can inherit from the OverlayController to implement their own scan screen user interfaces.

Since
4.7.0

Copyright 2010 Mirasense AG. All rights reserved.

Member Function Documentation

void SetBeepEnabled ( bool  enabled)

Enables (or disables) the sound when a barcode is recognized.

If the phone's ring mode is set to muted or vibrate, no beep will be played regardless of the value.

Enabled by default.

Since
1.0.0
Parameters
enabledWhether the beep is enabled.
void SetVibrateEnabled ( bool  enabled)

Enables or disables the vibration when a code was recognized.

If the phone's ring mode is set to muted, no beep will be played regardless of the value.

Enabled by default.

Since
1.0.0
Parameters
enabledWhether vibrate is enabled.
bool SetScanSoundResource ( String  path,
String  extension 
)

Sets the audio sound played when a code has been successfully recognized.

File needs to be placed in Resources folder.

Note: This feature is only available with the Scandit SDK Enterprise Packages.

The default is: "beep.wav"

Since
2.0.0
Parameters
pathThe file name of the sound file (without suffix).
extensionThe file type.
Returns
Whether the change was successful.
void SetTorchEnabled ( bool  enabled)

Enables or disables the torch toggle button for all devices/cameras that support a torch.

By default it is enabled. The torch icon is never shown when the camera does not have a torch (most tablets, front cameras, etc).

Since
2.0.0
Parameters
enabledWhether the torch button should be shown.
bool SetTorchOnImage ( UIImage  image,
UIImage  pressedImage 
)

Sets the images which are being drawn when the torch is on.

By default these are "flashlight-turn-off-icon.png" and "flashlight-turn-off-icon-pressed.png" which come with the framework's resource bundle.

Since
4.7.0
Parameters
imageThe image for when the torch is on.
pressedImageThe image for when the torch is on and it is pressed.
Returns
Whether the change was successful.
bool SetTorchOnImageResource ( String  fileName,
String  pressedFileName,
String  extension 
)

Sets the images which are being drawn when the torch is on.

If you want this to be displayed in proper resolution on high resolution screens, you need to also provide a resource with the same name but \2x appended and in higher resolution (like flashlight-turn-on-icon\2x.png).

File needs to be placed in Resources folder.

By default this is: "flashlight-turn-off-icon.png" and "flashlight-turn-off-icon-pressed.png"

Since
2.0.0
Parameters
fileNameThe file name for when the torch is on (without suffix).
pressedFileNameThe file name for when the torch is on and it is pressed (without suffix).
extensionThe file type.
Returns
Whether the change was successful.
bool SetTorchOffImage ( UIImage  image,
UIImage  pressedImage 
)

Sets the images which are being drawn when the torch is off.

By default this is: "flashlight-turn-on-icon.png" and "flashlight-turn-on-icon-pressed.png" which come with the framework's resource bundle.

Since
4.7.0
Parameters
imageThe image for when the torch is off.
pressedImageThe image for when the torch is off and it is pressed.
Returns
Whether the change was successful.
bool SetTorchOffImageResource ( String  fileName,
String  pressedFileName,
String  extension 
)

Sets the images which are being drawn when the torch is off.

If you want this to be displayed in proper resolution on high resolution screens, you need to also provide a resource with the same name but \2x appended and in higher resolution (like flashlight-turn-on-icon\2x.png).

By default this is: "flashlight-turn-on-icon.png" and "flashlight-turn-on-icon-pressed.png"

Since
2.0.0
Parameters
fileNameThe file name for when the torch is off (without suffix).
pressedFileNameThe file name for when the torch is off and it is pressed (without suffix).
extensionThe file type.
Returns
Whether the change was successful.
void SetTorchButtonMarginsAndSize ( float  leftMargin,
float  topMargin,
float  width,
float  height 
)

Sets the position at which the button to enable the torch is drawn.

By default the margins are 15 and width and height are 40.

Since
4.7.0
Parameters
leftMarginLeft margin in points.
topMarginTop margin in points.
widthWidth in points.
heightHeight in points.
void SetTorchOffAccessibilityLabel ( String  label,
String  hint 
)

Sets the accessibility label and hint for the torch button while the torch is off.

The accessibility label and hint give vision-impaired users voice over guidance for the torch button while the torch is turned on. The default label is "Torch Switch (Currently Off)", the default hint "Double-tap to switch the torch on"

Since
4.9.0
Parameters
labelThe accessibility label.
hintThe accessibility hint.
void SetTorchOnButtonAccessibilityLabel ( String  label,
String  hint 
)

Sets the accessibility label and hint for the torch button while the torch is on.

The accessibility label and hint give vision-impaired users voice over guidance for the torch button while the torch is turned on. The default label is "Torch Switch (Currently On)", the default hint "Double-tap to switch the torch off"

Since
4.9.0
Parameters
labelThe accessibility label.
hintThe accessibility hint.
void SetCameraSwitchVisibility ( CameraSwitchVisibility  visibility)

Sets when the camera switch button is visible for devices that have more than one camera.

By default it is ScanditBarcodeScanner.iOS.CameraSwitchVisibility.Never.

Since
3.0.0
Parameters
visibilityThe visibility of the camera switch button CameraSwitchVisibility.Never, CameraSwitchVisibility.OnTablet, CameraSwitchVisibility.Always
bool SetCameraSwitchImage ( UIImage  image,
UIImage  pressedImage 
)

Sets the images which are being drawn when the camera switch button is visible.

By default this is "camera-swap-icon.png" and "camera-swap-icon-pressed.png" which come with the framework's resource bundle.

Since
4.7.0
Parameters
imageThe image for the camera swap button.
pressedImageThe image for the camera swap button when pressed.
Returns
Whether the change was successful.
bool SetCameraSwitchImageResource ( String  fileName,
String  pressedFileName,
String  extension 
)

Sets the images which are being drawn when the camera switch button is visible.

If you want this to be displayed in proper resolution on high resolution screens, you need to also provide a resource with the same name but \2x appended and in higher resolution (like flashlight-turn-on-icon\2x.png).

File needs to be placed in Resources folder.

By default this is: "camera-swap-icon.png" and "camera-swap-icon-pressed.png"

Since
3.0.0
Parameters
fileNameThe file name of the camera swap button's image (without suffix).
pressedFileNameThe file name of the camera swap button's image when pressed (without suffix).
extensionThe file type.
Returns
Whether the change was successful.
void SetCameraSwitchButtonMarginsAndSize ( float  rightMargin,
float  topMargin,
float  width,
float  height 
)

Sets the position at which the button to switch the camera is drawn.

Be aware that the x coordinate is calculated from the right side of the screen and not the left like with the torch button.

By default this is set to x = 15, y = 15, width = 40 and height = 40.

Since
3.0.0
Parameters
rightMarginRight margin in points.
topMarginTop margin in points
widthWidth in points.
heightHeight in points.
void SetCameraSwitchButtonBackAccessibilityLabel ( String  label,
String  hint 
)

Sets the accessibility label and hint for the camera switch button while the back-facing camera is active.

The accessibility label and hint give vision-impaired users voice over guidance for the camera switch button while the back-facing camera is active. The default label is "Camera Switch (Currently back-facing)", the default hint "Double-tap to switch to the front-facing camera".

Since
4.9.0
Parameters
labelThe accessibility label.
hintThe accessibility hint.
void SetCameraSwitchButtonFrontAccessibilityLabel ( String  label,
String  hint 
)

Sets the accessibility label and hint for the camera switch button while the front-facing camera is active.

The accessibility label and hint give vision-impaired users voice over guidance for the camera switch button while the front-facing camera is active. The default label is "Camera Switch (Currently front-facing)", the default hint "Double-tap to switch to the back-facing camera".

Since
4.9.0
Parameters
labelThe accessibility label.
hintThe accessibility hint.
void SetViewfinderDimension ( float  height,
float  width,
float  landscapeHeight,
float  landscapeWidth 
)

Sets the size of the viewfinder relative to the size of the BarcodePicker's size.

Changing this value does not(!) affect the area in which barcodes are successfully recognized. It only changes the size of the box drawn onto the scan screen. To restrict the active scanning area, use the methods listed below.

See also
ScanditBarcodeScanner.iOS.BarcodePicker.RestrictActiveScanningArea
ScanditBarcodeScanner.iOS.BarcodePicker.SetScanningHotSpot
ScanditBarcodeScanner.iOS.BarcodePicker.SetScanningHotSpotHeight

By default the width is 0.8, height is 0.4, landscapeWidth is 0.6, landscapeHeight is 0.4

Since
3.0.0
Parameters
heightHeight of the viewfinder rectangle in portrait orientation.
widthWidth of the viewfinder rectangle in portrait orientation.
landscapeHeightHeight of the viewfinder rectangle in landscape orientation.
landscapeWidthWidth of the viewfinder rectangle in landscape orientation.
void SetViewfinderPortraitDimension ( float  width,
float  height 
)

Sets the size of the viewfinder relative to the size of the BarcodePicker's size for the portrait orientation.

Changing this value does not(!) affect the area in which barcodes are successfully recognized. It only changes the size of the box drawn onto the scan screen. To restrict the active scanning area, use the methods listed below.

See also
ScanditBarcodeScanner.iOS.BarcodePicker.RestrictActiveScanningArea
ScanditBarcodeScanner.iOS.BarcodePicker.SetScanningHotSpot
ScanditBarcodeScanner.iOS.BarcodePicker.SetScanningHotSpotHeight

By default the width is 0.8, height is 0.4

Since
4.16.0
Parameters
widthWidth of the viewfinder rectangle in portrait orientation.
heightHeight of the viewfinder rectangle in portrait orientation.
void SetViewfinderLandscapeDimension ( float  width,
float  height 
)

Sets the size of the viewfinder relative to the size of the BarcodePicker's size for the landscape orientation.

Changing this value does not(!) affect the area in which barcodes are successfully recognized. It only changes the size of the box drawn onto the scan screen. To restrict the active scanning area, use the methods listed below.

See also
ScanditBarcodeScanner.iOS.BarcodePicker.RestrictActiveScanningArea
ScanditBarcodeScanner.iOS.BarcodePicker.SetScanningHotSpot
ScanditBarcodeScanner.iOS.BarcodePicker.SetScanningHotSpotHeight

By default the width is 0.6, height is 0.4

Since
4.16.0
Parameters
widthWidth of the viewfinder rectangle in landscape orientation.
heightHeight of the viewfinder rectangle in landscape orientation.
void SetViewfinderColor ( float  red,
float  green,
float  blue 
)

Sets the color of the viewfinder before a bar code has been recognized.

Note: This feature is only available with the Scandit SDK Enterprise Packages.

By default this is: white (1.0, 1.0, 1.0)

Since
1.0.0
Parameters
redRed component (between 0.0 and 1.0).
greenGreen component (between 0.0 and 1.0).
blueBlue component (between 0.0 and 1.0).
void SetViewfinderDecodedColor ( float  red,
float  green,
float  blue 
)

Sets the color of the viewfinder once the bar code has been recognized.

Note: This feature is only available with the Scandit SDK Enterprise Packages.

By default this is: light blue (0.222, 0.753, 0.8)

Since
1.0.0
Parameters
redRed component (between 0.0 and 1.0).
greenGreen component (between 0.0 and 1.0).
blueBlue component (between 0.0 and 1.0).
void ResetUI ( )

Resets the scan screen user interface to its initial state.

This resets the animation showing the barcode locations to its initial state.

Since
1.0.0
void ShowToolBar ( bool  show)

Adds (or removes) a tool bar to/from the bottom of the scan screen.

Since
1.0.0
Parameters
showboolean indicating whether toolbar should be shown.
void SetToolBarButtonCaption ( String  caption)

Sets the caption of the toolbar button.

By default this is: "Cancel"

Since
1.0.0
Parameters
captionstring used for cancel button caption
void SetMissingCameraPermissionInfoText ( String  infoText)

Sets the text shown if the camera can not be aquired because the app does not have permission to access the camera.

By default this is: "The Barcode Picker was unable to access the device's camera.\n\nGo to Settings -> Privacy -> Camera and check that this app has permission to use the camera."

Since
4.7.0
Parameters
infoTextText shown if the camera can not be aquired.
void SetMatrixScanHighlightingColor ( MatrixScanHighlightingState  state,
int  color 
)

Sets the color of the highlighting in the specified tracking state (MatrixScan).

Since
5.4.0
Parameters
stateA highlighting state. Must be one of MatrixScanHighlightingState.Localized, MatrixScanHighlightingState.Recognized, MatrixScanHighlightingState.Rejected.
colorA color.

Property Documentation

UIToolbar ToolBar
get

The tool bar that can be shown at the bottom of the scan screen.

Since
1.0.0
NSObject WeakCancelDelegate
getset

The overlay controller delegate that handles the didCancelWithStatus callback.

Since
4.7.0

The GUI style drawn to display the indicator where the code should be scanned and the visualization of recognized codes.

By default this is GuiStyle.Default.

Since
4.8.0