Enable / disable continuous scanning.
{"method" : "MWBcloseScannerOnDecode", "value" : [true]}
Should the scanner close after scanning has finished.
Default value is true (disable continuous scanning).
If false, result callback will be performed and scanner will be paused. The User can call resumeScanning to continue scanning, or closeScanner to close the scanner.
Ignore result if the same code is scanned in continuous scanning mode.
{"method" : "MWBduplicateCodeDelay", "value" : [1000]}
Time interval in milliseconds between 2 scan results with the same result.code
Note: Internal implementation uses seconds. Provided value is rounded.
Enable or disable camera switcher button on cameraPreview.
{"method" : "MWBenableCameraSwitcher", "value" : [true]}
Usually for situations where the device has multiple cameras, the camera switcher UI lists all found cameras, and allows to switch to a different camera. Doing so stops the current scanning and starts a new scanning session with the chosen camera.
By default MWBuseFrontCamera is used until another camera is selected (picked and switched to) from the camera switcher UI (either manually or by using the CAMERA_SWITCHER_USE_ON_START option).
Once a specific camera is selected (picked and switched to) from the camera switcher, the MWBuseFrontCamera setting no longer has effect.
Enable camera switcher button on cameraPreview. Default value is false (disabled).
Enable / disable the return of the captured frame in the result on a successful scan.
{"method" : "MWBenableCapturedFrameReturn", "value" : [true]}
Note: Depending on frame size i.e. camera resolution used, the captured frame object may take up a fair amount of memory, and won't be marked for GC as long as a reference exists to it. This effect may be further compounded if continuous scanning is used.
Should the captured frame of a successful scan be returned in the result.
Default value is false (captured frame will not be provided in result).
Enable or disable close button on cameraPreview (partial view).
If cameraPreview is in full screen mode, button will be present regardless of param.
{"method" : "MWBenableClose", "value" : [true]}
Enable close button on cameraPreview. Default value is false (disabled).
Enable or disable flash toggle button on cameraPreview.
If device doesn't support flash mode button will be hidden regardless of param.
{"method" : "MWBenableFlash", "value" : [true]}
Enable flash button on cameraPreview. Default value is true (enabled).
Enable or disable high resolution scanning. It's recommended to enable it when target barcodes are of high density or small footprint.
If device doesn't support high or exact resolution param will have no effect and closest available resolution will be used.
{"method" : "MWBenableHiRes", "value" : [mw_c.CamRes_HD]}
Enable high resolution (720p) or specify exact resolution. Default value is true (enabled) / CamRes_HD (720p).
Accepts
Enable mirrored camera preview.
The mirroring is done along the X-axis. It's recommended when the used camera is facing the user (i.e. front camera).
{"method" : "MWBenableMirroredPreview", "value" : [mw_c.MIRROR_FRONTCAM]}
The type of mirroring to apply. Default value is MIRROR_NONE.
Note: The MIRROR_FRONTCAM option relies on proper camera type (front or back) selection. While most often this will be correct (i.e. on mobile devices), it is not guaranteed to always be the case (depends on device, browser and camera).
Enable or disable zoom button on cameraPreview.
If device doesn't support zoom button will be hidden regardless of param.
{"method" : "MWBenableZoom", "value" : [true]}
Enable zoom button on cameraPreview. Default value is true (enabled).
Enables or disables symbology types to decode.
{"method" : "MWBsetActiveCodes", "value" : [
mw_c.MWB_CODE_MASK_QR |
mw_c.MWB_CODE_MASK_DM |
//mw_c.MWB_CODE_MASK_RSS |
//mw_c.MWB_CODE_MASK_39 |
mw_c.MWB_CODE_MASK_EANUPC |
mw_c.MWB_CODE_MASK_128 |
mw_c.MWB_CODE_MASK_PDF |
//mw_c.MWB_CODE_MASK_AZTEC |
//mw_c.MWB_CODE_MASK_25 |
//mw_c.MWB_CODE_MASK_93 |
//mw_c.MWB_CODE_MASK_CODABAR |
//mw_c.MWB_CODE_MASK_DOTCODE |
//mw_c.MWB_CODE_MASK_11 |
//mw_c.MWB_CODE_MASK_MSI |
//mw_c.MWB_CODE_MASK_MAXICODE |
//mw_c.MWB_CODE_MASK_POSTAL |
//mw_c.MWB_CODE_MASK_TELEPEN |
0x0 //for binary-OR syntax purposes
]}
ORed bit flags (MWB_CODE_MASK_...) of symbology types to be activated.
Sets active or inactive status of parser types.
{"method" : "MWBsetActiveParser", "value" : [mw_c.MWP_PARSER_MASK_GS1]}
ORed bit flags (MWP_PARSER_MASK_...) of parser types to be activated.
Note: The ISBT parser has been removed since version 1.0.4 in favor of reducing SDK size. Should there be a need for it, contact us.
Sets active subcodes for given code group flag. Subcodes under some symbology types are all activated by default.
{"method" : "MWBsetActiveSubcodes", "value" : [mw_c.MWB_CODE_MASK_RSS, mw_c.MWB_SUBC_MASK_RSS_14_STACK]}
Single symbology type/group (MWB_CODE_MASK_...)
ORed bit flags of requested symbology subtypes (MWB_SUBC_MASK_...)
Set the visibility of the cameraPreview blinking lines.
Note: This setting is also available as an API method.
{"method" : "MWBsetBlinkingLineVisible", "value" : [true]}
Visible blinking lines. Default value is true.
Choose configuration options for camera switcher.
{"method" : "MWBsetCameraSwitcherOptions", "value" : [
//mw_c.CAMERA_SWITCHER_INIT_ON_START |
//mw_c.CAMERA_SWITCHER_USE_ON_START |
//mw_c.CAMERA_SWITCHER_USE_BEST_CAMERA |
0x0 //for binary-OR syntax purposes
]}
Configuration options for camera switcher. Default value is 0x0 (no option enabled)
Set the amount of time in seconds the camera preview will be on before closeScanner is called.
{"method" : "MWBsetDecoderTimeout", "value" : [30]}
Time in seconds. Default value is 30.
Accepted value range is 10-60. Also accepts 0 to disable the timeout.
Values out of range will result in applying the default value 30.
This function enables some control over scanning lines choice for 1D barcodes. By ORing available bit-masks user can add one or more direction options to scanning lines set.
{"method" : 'MWBsetDirection', "value" : [mw_c.MWB_SCANDIRECTION_HORIZONTAL | mw_c.MWB_SCANDIRECTION_VERTICAL]}
ORed bit mask of direction modes given with MWB_SCANDIRECTION_... bit-masks
Set decodes per second, i.e. number of frames that are sent for decoding in a given second. This setting only works with our camera preview i.e. when using the startScanning method.
Performance: Use of a decodes per second limit is recommended, such as 1 or 2 at the most, and in reality, there is rarely a need for a higher decoding rate. Having a higher dps results in higher CPU usage, which can lead to non-responsiveness of the cameraPreview.
{"method" : "MWBsetDpsLimit", "value" : [2]}
Decodes per second limit. Default value is 2.
Accepted value range is 1-30.
Sets options (if any) for symbology type specified in codeMask. Options are given in flags as bitwise OR of option bits. Available options depend on selected symbology type.
{"method" : "MWBsetFlags", "value" : [0, mw_c.MWB_CFG_GLOBAL_ENABLE_MULTI]}
Single symbology type/group (MWB_CODE_MASK_...) or 0 for global flags
ORed bit mask of selected symbology type options (MWB_CFG_...) or global flags (MWB_CFG_GLOBAL_...)
Set the barcode scanner effort level.
Barcode detector relies on image processing and geometry interpolation for extracting optimal data for decoding. Higher effort level involves more processing and intermediate parameter values, thus increasing probability of successful detection with low quality images, but also consuming more CPU time.
Performance: Use suitable effort level for a given use case to balance successful detection and CPU usage. Effort levels 4 and 5 should be reserved for scanning from image only (non-live scanning).
{"method" : "MWBsetLevel", "value" : [2]}
Effort level - available values are 1, 2, 3, 4 and 5. Default value is 2. Levels greater than 3 are not suitable for real-time decoding.
Sets minimum result length for symbology type specified in codeMask.
{"method" : "MWBsetMinLength", "value" : [mw_c.MWB_CODE_MASK_25, 5]}
Single symbology type/group (MWB_CODE_MASK_...)
Minimum result length for selected symbology type
Choose overlay graphics type for cameraPreview.
Note: This setting is also available as an API method.
Note: Using OverlayModeMW is the only way to have a viewfinder on the cameraPreview, which indicates the active area the decoder is scanning. The viewfinder is a union of the scanning rectangles of all active codes.
{"method" : "MWBsetOverlayMode", "value" : [mw_c.OverlayModeImage]}
Overlay mode.
Note: The blinking lines visibility has priority over OverlayModeMW
Customize overlay appearance for OverlayModeMW.
{"method" : "MWBsetOverlayAppearance", "value" : [
{
"BorderVisible": true
,"BorderAndLinesColor": "rgba(255, 255, 0, 1.0)"
,"LocationBorderColor": "rgba(0, 255, 255, 1.0)"
,"LocationShowTime": 500
}
]}
An object of various overlay properties and their values.
Set custom symbology param id / value pair for symbology type specified in a codeMask.
{"method" : "MWBsetParam", "value" : [mw_c.MWB_CODE_MASK_39, mw_c.MWB_PAR_ID_VERIFY_LOCATION, mw_c.MWB_PAR_VALUE_VERIFY_LOCATION_ON]}
Single symbology type/group (MWB_CODE_MASK_...)
The ID of param
Integer value of param
Set cameraPreview pause mode.
{"method" : "MWBsetPauseMode", "value" : [mw_c.PM_STOP_BLINKING]}
Pause mode defines what happens when the scanner is paused. Default value is PM_STOP_BLINKING
Note: The blinking lines visibility has priority over PM_STOP_BLINKING
Sets rectangular area for barcode scanning with selected single symbology type.
After applying this setting, all subsequent scans will be restricted to this region. Only codes inside defined region are decoded. If rectangle is not set, whole image / frame is scanned. If width or height is zero, whole image / frame is scanned.
Dimensions parameters (left, top, width, height) are interpreted as percentage of image / frame dimensions, i.e. ranges are 0 - 100 for all parameters.
{"method" : "MWBsetScanningRect", "value" : [mw_c.MWB_CODE_MASK_PDF, 2, 2, 96, 96]}
Single symbology type/group (MWB_CODE_MASK_...)
X coordinate of left edge (percentage)
Y coordinate of top edge (percentage)
Rectangle width (x axis) (percentage)
Rectangle height (y axis) (percentage)
Set desired initial zoom level. Zoom is supported only by Chrome.
{"method" : "MWBsetZoomLevel", "value" : [1]}
Initial zoom level. Default is 0.
Set default state of flash (torch) when scanner is started.
{"method" : "MWBturnFlashOn", "value" : [true]}
Turn on initial flash state. Default value is false (disabled).
Use front facing camera.
{"method" : "MWBuseFrontCamera", "value" : [false]}
Whether or not to use front facing camera. Default value is false (i.e. use back camera).
Generated using TypeDoc
Barcode scanner configuration settings methods.
This is a collection of configuration methods, which are meant to be passed as JSON object literals in an array as param for the loadSettings method.
The loadSettings API method is meant to be called in the configuration stage, i.e. before starting a scan. Thus the configuration methods listed here control settings that can be changed prior and not during scanning.
However, there are a few methods that are safe to be used during scanning, so they are also available as API methods.
Configuration stage
The configuration stage is any code you place inside of the scannerConfig() method. The SDK will execute this method whenever needed depending on SDK use.
The configuration stage always precedes the scanning stage (i.e. the use of startScanning, scanImage or scanFrame API methods).
Here is an example of a typical configuration:
The methods listed below have an example JSON object literal which can be used in a settings array (as done in the configuration example above).