Label Capture Basic Overlay
Defined under the namespace Scandit.Datacapture.Label.Ui
- LabelCaptureBasicOverlay
class LabelCaptureBasicOverlay : DataCaptureOverlay
Added in version 6.5.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 (capturedFieldBrush, predictedFieldBrush), a brush set through a user-defined LabelCaptureBasicOverlayListener or calls to setBrushForFieldOfLabel().
- constructor(mode)
constructor(mode: LabelCapture)
Added in version 7.6.0
Construct a new LabelCaptureBasicOverlay. For the overlay to be displayed on screen, it must be added to a DataCaptureView.
- listener
listener: LabelCaptureBasicOverlayListener | null
Added in version 6.5.0
- setBrushForFieldOfLabel(brush, field, label)
setBrushForFieldOfLabel(brush: Brush, field: LabelField, label: CapturedLabel): Promise<
void>Added in version 6.5.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.
This method is thread-safe; it can be called from any thread. When listener is set to a non-null instance, the listener continues to be asked for the brush to use for this field whenever the state changes, thereby replacing any brushes set by calling setBrushForFieldOfLabel().
- setBrushForLabel(brush, label)
setBrushForLabel(brush: Brush, label: CapturedLabel): Promise<
void>Added in version 6.5.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.
When listener is set to a non-null instance, the listener continues to be asked for the brush to use for this label whenever the state of one its fields changes, thereby replacing any brushes set by calling setBrushForLabel().
- defaultPredictedFieldBrush
static get defaultPredictedFieldBrush(): Brush
Added in version 6.5.0
The default brush applied to predicted fields. This is the brush used if LabelCaptureBasicOverlayListener is not set.
- defaultCapturedFieldBrush
static get defaultCapturedFieldBrush(): Brush
Added in version 6.5.0
The default brush applied to captured fields. This is the brush used if LabelCaptureBasicOverlayListener is not set.
- defaultLabelBrush
static get defaultLabelBrush(): Brush
Added in version 6.5.0
The default brush used for drawing labels. This brush is used when no listener is set, or the LabelCaptureBasicOverlayListener.brushForLabel() returns a null brush.
- predictedFieldBrush
predictedFieldBrush: Brush | null
Added in version 6.5.0
The brush applied to predicted fields if no LabelCaptureBasicOverlayListener is set.
- capturedFieldBrush
capturedFieldBrush: Brush | null
Added in version 6.5.0
The brush applied to captured fields if no LabelCaptureBasicOverlayListener is set.
- labelBrush
labelBrush: Brush | null
Added in version 6.5.0
The brush used for drawing labels if no listener is set, or the LabelCaptureBasicOverlayListener.brushForLabel() returns a null brush.
- shouldShowScanAreaGuides
shouldShowScanAreaGuides: boolean
Added in version 6.5.0
Controls whether scan area guides are displayed over the camera preview. These guides help visualize the active scanning regions during development and debugging.
This feature is intended for development purposes only and should not be enabled in production applications. By default this property is false.
- viewfinder
viewfinder: Viewfinder | null
Added in version 6.8.0
The viewfinder used to guide users during the scanning process. The viewfinder provides visual cues about the optimal scanning area and helps users position labels correctly.
By default, no viewfinder is displayed. Set this to an instance of Viewfinder (such as RectangularViewfinder) to provide scanning guidance to users.