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
Public Member Functions | |
void | SetGuiStyle (int guiStyle) |
Sound Configuration | |
Customize the scan sound. | |
void | SetBeepEnabled (boolean enabled) |
void | SetVibrateEnabled (boolean enabled) |
Torch Configuration | |
Enable and customize appearance of the torch icon. | |
void | SetTorchEnabled (boolean enabled) |
void | SetTorchOnImage (Bitmap image) |
void | SetTorchOnImage (Bitmap image, Bitmap pressedImage) |
void | SetTorchOffImage (Bitmap image) |
void | SetTorchOffImage (Bitmap image, Bitmap pressedImage) |
void | SetTorchButtonMarginsAndSize (int leftMargin, int topMargin, int width, int height) |
void | SetTorchOffContentDescription (String contentDescription) |
void | SetTorchOnContentDescription (String contentDescription) |
Camera Switch Configuration | |
Enable camera switch and set icons | |
void | SetCameraSwitchVisibility (int visibility) |
void | SetCameraSwitchImage (Bitmap image, Bitmap pressedImage) |
void | SetCameraSwitchButtonMarginsAndSize (int rightMargin, int topMargin, int width, int height) |
void | SetCameraSwitchBackContentDescription (String contentDescription) |
void | SetCameraSwitchFrontContentDescription (String contentDescription) |
Viewfinder Configuration | |
Customize the viewfinder where the barcode location is highlighted. | |
void | SetViewfinderDimension (float width, float height, float landscapeWidth, float landscapeHeight) |
void | SetViewfinderColor (float r, float g, float b) |
void | SetViewfinderDecodedColor (float r, float g, float b) |
Non-Official Methods | |
void | SetProperty (String key, Object value) |
Static Public Attributes | |
Camera Switch Button Visibility | |
static final int | CameraSwitchNever |
static final int | CameraSwitchOnTablet |
static final int | CameraSwitchAlways |
Scan UI style | |
static final int | GuiStyleDefault |
static final int | GuiStyleLaser |
static final int | GuiStyleNone |
Detailed Description
Abstract scan UI class.
The ScanOverlay implements the scan UI displayed on top of the video feed. It is responsible for highlighting barcodes and draw the viewfinder rectangle or laser UI.
Member Function Documentation
void SetGuiStyle | ( | int | guiStyle | ) |
The GUI style drawn to display the indicator where the code should be scanned and the visualization of recognized codes.
- Parameters
-
guiStyle Must be one of GuiStyleDefault or GuiStyleDefault. By default this is GuiStyleDefault.
- Since
- 4.9.0
void SetBeepEnabled | ( | boolean | 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
- 4.9.0
- Parameters
-
enabled Whether the beep is enabled.
void SetVibrateEnabled | ( | boolean | 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
- 4.9.0
- Parameters
-
enabled Whether vibrate is enabled.
void SetTorchEnabled | ( | boolean | 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
- 4.9.0
- Parameters
-
enabled Whether the torch button should be shown.
void SetTorchOnImage | ( | Bitmap | image | ) |
Sets the image which is being drawn when the torch is on.
If you want this to be displayed in proper resolution on high resolution screens, you need to provide a resource big enough to work with at least xhdpi resolution.
- Since
- 4.9.0
- Parameters
-
image The new image for when the torch is on.
void SetTorchOnImage | ( | Bitmap | image, |
Bitmap | pressedImage | ||
) |
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 provide a resource big enough to work with at least xhdpi resolution.
- Since
- 4.9.0
- Parameters
-
image The new image for when the torch is on. pressedImage The new image for when the torch is on and it is pressed.
void SetTorchOffImage | ( | Bitmap | image | ) |
Sets the image which is being drawn when the torch is off.
If you want this to be displayed in proper resolution on high resolution screens, you need to provide a resource big enough to work with at least xhdpi resolution.
- Since
- 4.9.0
- Parameters
-
image The new image for when the torch is off.
void SetTorchOffImage | ( | Bitmap | image, |
Bitmap | pressedImage | ||
) |
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 provide a resource big enough to work with at least xhdpi resolution.
- Since
- 4.9.0
- Parameters
-
image The new image for when the torch is off. pressedImage The new image for when the torch is off and it is pressed.
void SetTorchButtonMarginsAndSize | ( | int | leftMargin, |
int | topMargin, | ||
int | width, | ||
int | 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
-
leftMargin Left margin in points. topMargin Top margin in points. width Width in points. height Height in points.
void SetTorchOffContentDescription | ( | String | contentDescription | ) |
Sets the content description for the torch button while the torch is off.
The content description gives vision-impaired users voice over guidance for the torch button while the torch is turned off. The default label is "Torch Switch (Currently Off)".
- Since
- 4.9.0
- Parameters
-
contentDescription The content description.
void SetTorchOnContentDescription | ( | String | contentDescription | ) |
Sets the content description for the torch button while the torch is on.
The content description gives vision-impaired users voice over guidance for the torch button while the torch is turned on. The default label is "Torch Switch (Currently On)".
- Since
- 4.9.0
- Parameters
-
contentDescription The content description.
void SetCameraSwitchVisibility | ( | int | visibility | ) |
Sets when the camera switch button is visible for devices that have more than one camera.
By default it is CameraSwitchNever.
- Since
- 4.9.0
- Parameters
-
visibility The visibility of the camera switch button (CameraSwitchNever, CameraSwitchOnTablet, CameraSwitchAlways)
void SetCameraSwitchImage | ( | Bitmap | image, |
Bitmap | pressedImage | ||
) |
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 flash). ligh t-tur n-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
- 4.9.0
- Parameters
-
image The new image for the camera swap button. pressedImage The new image for the camera swap button when it is pressed.
void SetCameraSwitchButtonMarginsAndSize | ( | int | rightMargin, |
int | topMargin, | ||
int | width, | ||
int | height | ||
) |
Sets the position at which the button to switch the camera is drawn.
By default the margins are 15 and width and height are 40.
- Since
- 3.0.0
- Parameters
-
rightMargin Right margin in dp. topMargin Top margin in dp. width Width in dp. height Height in dp.
void SetCameraSwitchBackContentDescription | ( | String | contentDescription | ) |
Sets the content description for the camera switch button while the back-facing camera is active.
The content description gives vision-impaired users voice over guidance for the camera switch button while the back-facing camera is active. The default description is "Camera Switch (Currently back-facing)".
- Since
- 4.9.0
- Parameters
-
contentDescription The content description.
void SetCameraSwitchFrontContentDescription | ( | String | contentDescription | ) |
Sets the content description for the camera switch button while the front-facing camera is active.
The content description gives vision-impaired users voice over guidance for the camera switch button while the front-facing camera is active. The default description is "Camera Switch (Currently front-facing)".
- Since
- 4.9.0
- Parameters
-
contentDescription The content description.
void SetViewfinderDimension | ( | float | width, |
float | height, | ||
float | landscapeWidth, | ||
float | landscapeHeight | ||
) |
Sets the size of the viewfinder relative to the size of the screen 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
- ScanSettings.enableRestrictedAreaScanning(boolean)
- ScanSettings.setScanningHotSpot(float, float)
- ScanSettings.setScanningHotSpotHeight(float)
By default the width is 0.8, height is 0.4, landscapeWidth is 0.6, landscapeHeight is 0.4
- Since
- 4.9.0
- Parameters
-
width Width of the viewfinder rectangle in portrait orientation. height Height of the viewfinder rectangle in portrait orientation. landscapeWidth Width of the viewfinder rectangle in landscape orientation. landscapeHeight Height of the viewfinder rectangle in landscape orientation.
void SetViewfinderColor | ( | float | r, |
float | g, | ||
float | b | ||
) |
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
- 4.9.0
- Parameters
-
r Red component (between 0.0 and 1.0). g Green component (between 0.0 and 1.0). b Blue component (between 0.0 and 1.0).
void SetViewfinderDecodedColor | ( | float | r, |
float | g, | ||
float | b | ||
) |
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
- 4.9.0
- Parameters
-
r Red component (between 0.0 and 1.0). g Green component (between 0.0 and 1.0). b Blue component (between 0.0 and 1.0).
void SetProperty | ( | String | key, |
Object | value | ||
) |
Set custom property.
This function is for internal use/and or experimental features and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not use this method unless you specifically have to.
- Parameters
-
key The name of the property value the value for the property.
Member Data Documentation
|
static |
The camera switch button is always hidden.
|
static |
The camera switch button is shown on tablet devices with front and back cameras.
|
static |
The camera switch button is shown on all devices that have front and back cameras.
|
static |
A rectangular viewfinder with rounded corners is shown in the specified size.
Recognized codes are marked with four corners.
|
static |
A laser line is shown with the specified width while the height is not changeable.
This mode should generally not be used if the recognition is running on the whole screen as it indicates that the code should be placed at the location of the laser line.
|
static |
No UI is shown to indicate where the barcode should be placed.
Be aware that the Scandit logo continues to be displayed as showing it is part of the license agreement.