Barcode Capture Overlay

Defined in package com.scandit.datacapture.barcode.ui.overlay

BarcodeCaptureOverlayStyle

Added in version 6.10.0

The style of the BarcodeCaptureOverlay.

Deprecated since version 6.26: This enum is deprecated and will be removed in the future.

LEGACY

Added in version 6.10.0

Legacy style from versions before 6.10.

FRAME

Added in version 6.10.0

Style that draws the highlights as a rectangular frame and adds an animation for when a code is scanned.

BarcodeCaptureOverlay
class BarcodeCaptureOverlay : DataCaptureOverlay

Added in version 6.0.0

Overlay for the BarcodeCapture capture mode that displays recognized barcodes on top of a data capture view.

The appearance of the visualized barcodes can be configured or turned off completely through the brush property.

newInstance(mode, view)
static @NonNull BarcodeCaptureOverlay newInstance(@NonNull BarcodeCapture mode,
        @Nullable DataCaptureView view)

Added in version 6.0.0

Constructs a new barcode capture overlay for the provided barcode capture instance. When passing a non-null view instance, the overlay is automatically added to the view.

newInstance(mode, view, style)
static @NonNull BarcodeCaptureOverlay newInstance(@NonNull BarcodeCapture mode,
        @Nullable DataCaptureView view,
        BarcodeCaptureOverlayStyle style)

Added in version 6.10.0

Constructs a new barcode capture overlay for the provided barcode capture instance and style. When passing a non-null view instance, the overlay is automatically added to the view.

fromJson(mode, jsonData)
static @NonNull BarcodeCaptureOverlay fromJson(@NonNull BarcodeCapture mode,
        @NonNull String jsonData)

Added in version 6.0.0

Constructs a new barcode capture overlay with the provided JSON serialization.

For the overlay to be displayed on screen, it must be added to a DataCaptureView.

viewfinder
@Nullable Viewfinder getViewfinder()
void setViewfinder(@Nullable Viewfinder value)

Added in version 6.0.0

Set the viewfinder. By default, the viewfinder is null. Set this to an instance of Viewfinder if you want to draw a viewfinder.

brush
@NonNull Brush getBrush()
void setBrush(@NonNull Brush value)

Added in version 6.0.0

The brush used for visualizing a recognized barcode in the UI. To turn off drawing of locations, set the brush to use both a transparent fill and stroke color. By default, the brush has a transparent fill color, a “Scandit”-blue stroke color, and a stroke width of 1.

defaultBrush()
static @NonNull Brush defaultBrush()

Added in version 6.0.0

Returns the default brush used by the overlay.

Deprecated since version 6.7.0: The defaultBrush of the overlay depends on the style used, there is no unique default brush. Use defaultBrush() instead.

DEFAULT_BRUSH
static final @NonNull Brush DEFAULT_BRUSH

Added in version 6.7.0

Returns the default brush used by the overlay.

Deprecated since version 6.10.1: The defaultBrush of the overlay depends on the style used, there is no unique default brush. Use defaultBrush() instead.

defaultBrush(style)
static Brush defaultBrush(BarcodeCaptureOverlayStyle style)

Added in version 6.10.1

Returns the default brush for the given style.

shouldShowScanAreaGuides
boolean getShouldShowScanAreaGuides()
void setShouldShowScanAreaGuides(boolean value)

Added in version 6.0.0

Whether to show scan area guides on top of the preview. This property is useful during development to visualize the current scan areas on screen. It is not meant to be used for production. By default this property is false.

updateFromJson(jsonData)
void updateFromJson(@NonNull String jsonData)

Added in version 6.0.0

Updates the overlay according to a JSON serialization.

setProperty(name, value)
void setProperty(@NonNull String name,
        @NonNull Object value)

Added in version 6.0.0

Set barcode capture overlay property to the provided value. Use this method to set properties that are not yet part of a stable API. Properties set through this method may or may not be used or change in a future release.

getProperty(name)
@Nullable Object getProperty(@NonNull String name)

Added in version 6.0.0

Retrieves the value of a previously set barcode capture overlay property. In case the property does not exist, null is returned.

style
BarcodeCaptureOverlayStyle getStyle()

Added in version 6.10.0

The overlay style. Defaults to Legacy.