Label Capture Basic Overlay

Defined under the namespace Scandit.Datacapture.Label.Ui

LabelCaptureBasicOverlay
class LabelCaptureBasicOverlay : DataCaptureOverlay

Added in version 7.2.0

Overlay for label capture that provides visual feedback and customization capabilities for the scanning process. This overlay displays captured labels and their fields on top of the camera preview, offering extensive customization options through listener interfaces.

Key visualization features:

  • Label highlighting - Configurable visual feedback for detected labels

  • Field state indication - Different visual styles for predicted vs. captured fields

  • Custom brush configuration - Fully customizable appearance for labels and fields

  • Listener-based customization - Programmatic control over field appearances

The overlay distinguishes between different field states:

  • Predicted fields - Fields that have been detected but not yet captured

  • Captured fields - Fields that have been successfully scanned and validated

Advanced customization is available through LabelCaptureBasicOverlayListener, allowing dynamic styling based on field content, validation status, or other contextual information.,

Fields are highlighted using a default brush (getDefaultFieldBrush() with LabelFieldState.Captured, getDefaultFieldBrush() with LabelFieldState.Predicted), a brush set through a user-defined LabelCaptureBasicOverlayListener or calls to setBrushForField().

withLabelCaptureForView(labelCapture, view)
static withLabelCaptureForView(labelCapture: LabelCapture,
        view: DataCaptureView): Promise<LabelCaptureBasicOverlay>

Added in version 7.2.0

Constructs a new overlay to visualize the process of label capture. When view is non-null, the overlay is automatically added to the view. Otherwise, the overlay needs to be added through a call to DataCaptureView.addOverlay().

withLabelCapture(labelCapture)
static withLabelCapture(labelCapture: LabelCapture): Promise<LabelCaptureBasicOverlay>

Added in version 7.2.0

Constructs a new overlay to visualize the process of label capture. The overlay needs to be added through a call to DataCaptureView.addOverlay().

setListener(labelCaptureBasicOverlayListener)
setListener(labelCaptureBasicOverlayListener?: LabelCaptureBasicOverlayListener): Promise<void>

Added in version 7.2.0

getListener()
getListener(): Promise<LabelCaptureBasicOverlayListener | null>

Added in version 7.2.0

setBrushForField(brush, field, label)
setBrushForField(brush: Brush,
        field: LabelField,
        label: CapturedLabel): Promise<void>

Added in version 7.2.0

Sets a custom brush to visually highlight a specific field within a captured label. This allows for dynamic styling based on field content, validation status, or other contextual information.

Use this method to provide visual feedback for specific fields, such as highlighting errors, successful captures, or fields requiring attention.

setBrushForLabel(brush, label)
setBrushForLabel(brush: Brush,
        label: CapturedLabel): Promise<void>

Added in version 7.2.0

Sets a custom brush to visually highlight a specific captured label. This allows for dynamic styling of entire labels based on their completion status, validation results, or other contextual information.

Use this method to provide visual feedback for labels, such as highlighting complete vs. incomplete labels, or marking labels that require validation. This method is thread-safe; it can be called from any thread.

getDefaultFieldBrush(fieldState)
getDefaultFieldBrush(fieldState: LabelFieldState): Promise<Brush>

Added in version 7.2.0

Returns the default brush to draw fields of the provided state. Valid values for state are LabelFieldState.Predicted and LabelFieldState.Captured.

setDefaultFieldBrush(brush, fieldState)
setDefaultFieldBrush(brush: Brush,
        fieldState: LabelFieldState): Promise<void>

Added in version 7.2.0

Sets the default brush to draw fields of the provided state. Valid values for state are LabelFieldState.Predicted and LabelFieldState.Captured.

getDefaultLabelBrush()
getDefaultLabelBrush(): Promise<Brush>

Added in version 7.2.0

Returns the default brush used for drawing labels.

setDefaultLabelBrush(brush)
setDefaultLabelBrush(brush: Brush): Promise<void>

Added in version 7.2.0

Sets the default brush used for drawing labels.

getShouldShowScanAreaGuides()
getShouldShowScanAreaGuides(): Promise<boolean>

Added in version 7.2.0

Returns whether scan area guides are shown on top of the preview.

setShouldShowScanAreaGuides(value)
setShouldShowScanAreaGuides(value: boolean): Promise<void>

Added in version 7.2.0

Sets whether to show scan area guides on top of the preview.

getViewfinder()
getViewfinder(): Promise<Viewfinder | null>

Added in version 7.2.0

Returns the current viewfinder.

setViewfinder(viewFinder)
setViewfinder(viewFinder: Viewfinder): Promise<void>

Added in version 7.2.0

Sets the viewfinder. By default, the viewfinder is null. Call this method with an instance of Viewfinder if you want to draw a viewfinder.