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 React Native

Scandit.BarcodePicker Class Reference

Public Member Functions

void applySettings (ScanSettings settings)
 
void pauseScanning ()
 
void resumeScanning ()
 
void stopScanning ()
 
void startScanning ()
 
void setGuiStyle (int guiStyle)
 
void setMatrixScanHighlightingColor (int state, Object color)
 
Sound Configuration

Customize the scan sound.

void setBeepEnabled (boolean enabled)
 
void setVibrateEnabled (boolean enabled)
 
Viewfinder Configuration

Customize the viewfinder where the barcode location is highlighted.

void setViewfinderDimension (number width, number height, number landscapeWidth, number landscapeHeight)
 
void setViewfinderColor (Object color)
 
void setViewfinderDecodedColor (Object color)
 
Non-Official Methods
void setOverlayProperty (String key, Object value)
 

Public Attributes

ScanSettings scanSettings
 
function onScan
 
function onRecognizeNewCodes
 
function onSettingsApplied
 
function onTextRecognized
 

Detailed Description

The main class for scanning barcodes with the Scandit Barcode Scanner.

This class sets up the recognition process, the preview view, controls the camera and provides a callback interface when barcodes are recognized.

Member Function Documentation

void applySettings ( ScanSettings  settings)

Reconfigure the barcode picker with new settings.

The settings are applied asynchronously. Once they have been applied, all new frames will be processed with the new settings.

Parameters
settingsthe settings to apply.
void pauseScanning ( )

Asynchronously pause the scanning process while keeping the camera preview running.

Use this method when you plan to briefly pause the scanning process and intend to resume it later. It is not recommended to use this method when you are interrupting the scanning process for longer periods of time as the camera preview will use considerable power. For such scenarios use ScanSession.stopScanning instead.

void resumeScanning ( )

Asynchronously resume a previously paused scanning process.

Use this method to resume scanning after ScanSession.pauseScanning or pauseScanning was called. Calling resume on a picker that was not previously started with with startScanning() is undefined.

void stopScanning ( )

Asynchronously stop the scanning process and camera preview.

void startScanning ( )

Asynchronously start the camera preview and scanning process.

void setGuiStyle ( int  guiStyle)

Set the barcode picker GUI style.

Parameters
guiStylethe gui style to set, see ScanOverlay.GuiStyle
void setMatrixScanHighlightingColor ( int  state,
Object  color 
)

Set the matrix scanning highlighting color.

Parameters
statethe state for which you want to change the color, see ScanOverlay.MatrixScanState
colorthe color you want to set, this parameter can be a hex string or a color literal such as 'red' or 'yellow'
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.

Parameters
enabledwhether 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.

Parameters
enabledwhether vibrate is enabled.
void setViewfinderDimension ( number  width,
number  height,
number  landscapeWidth,
number  landscapeHeight 
)

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.

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

Parameters
widthWidth of the viewfinder rectangle in portrait orientation.
heightHeight of the viewfinder rectangle in portrait orientation.
landscapeWidthWidth of the viewfinder rectangle in landscape orientation.
landscapeHeightHeight of the viewfinder rectangle in landscape orientation.
void setViewfinderColor ( Object  color)

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 the color is white

Parameters
colorthe color to set, this parameter can be a hex string or a color literal such as 'red' or 'yellow'
void setViewfinderDecodedColor ( Object  color)

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 the color is light blue

Parameters
colorthe color to set, this parameter can be a hex string or a color literal such as 'red' or 'yellow'
void setOverlayProperty ( String  key,
Object  value 
)

Set custom overlay 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
keyThe name of the property
valuethe value for the property.

Member Data Documentation

ScanSettings scanSettings

Prop used to pass the initial scan settings to the picker.

function onScan

Prop used to set the scan callback.

function onRecognizeNewCodes

Prop used to set the matrix scan callback.

function onSettingsApplied

Prop used to set a callback called after new settings have been applied.

function onTextRecognized

Prop used to set the text recognition callback.