Label Capture Advanced Overlay

Defined in namespace Scandit.DataCapture.Label.UI.Overlay

LabelCaptureAdvancedOverlay
class LabelCaptureAdvancedOverlay : IDataCaptureOverlay

Added in version 7.5.0

An advanced overlay for DataCaptureView that enables rich AR-style experiences by allowing custom views to be anchored to captured labels and their individual fields (label location is only supported in some use cases at the moment).

This overlay provides sophisticated augmented reality capabilities, allowing you to create dynamic AR elements that react to captured label content. The provided views maintain their relative position to labels and fields as they move in the camera preview, enabling real-time contextual information display.

Advanced AR use cases include:

  • Dynamic warnings - Display alerts for items near expiration based on captured dates

  • Contextual information - Show additional product details or pricing information

  • Field-specific feedback - Provide targeted visual feedback for individual label fields

  • Custom validation indicators - Create sophisticated validation interfaces

The overlay supports both label-level and field-level view anchoring, providing fine-grained control over AR element positioning and behavior.

To display the views, this overlay must be attached to a DataCaptureView. This may be done either by creating it with NewInstance() with a non-null view parameter or by passing this overlay to DataCaptureView.AddOverlay().

A user of this class may configure what view is displayed for the given label and the relative position between the two by implementing ILabelCaptureAdvancedOverlayListener.

NewInstance()
static LabelCaptureAdvancedOverlay NewInstance(LabelCapture mode, DataCaptureView view)

Added in version 7.5.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().

Listener
ILabelCaptureAdvancedOverlayListener Listener { get;set; }

Added in version 7.5.0

The listener which is called whenever a view, an anchor point and an offset must be defined for a tracked CapturedLabel.

ShouldShowScanAreaGuides
bool ShouldShowScanAreaGuides { get;set; }

Added in version 7.5.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.

SetViewForCapturedLabel()
void SetViewForCapturedLabel(CapturedLabel capturedLabel, View view)

Added in version 7.5.0

The method can be called to change the view drawn for the given tracked label. Setting the view to null will unset the view from the tracked label and will effectively remove it from the overlay. This method is thread-safe, it can be called from any thread. The view set via this method will take precedence over the one set via ILabelCaptureAdvancedOverlayListener.ViewForCapturedLabel(): in case a view is set before ILabelCaptureAdvancedOverlayListener.ViewForCapturedLabel() got called, no call to ILabelCaptureAdvancedOverlayListener.ViewForCapturedLabel() will happen.

SetAnchorForCapturedLabel()
void SetAnchorForCapturedLabel(CapturedLabel capturedLabel, Anchor anchor)

Added in version 7.5.0

The method can be called to change the anchor point for the view associated with the given tracked label. This method is thread-safe, it can be called from any thread. The anchor set via this method will take precedence over the one set via ILabelCaptureAdvancedOverlayListener.AnchorForCapturedLabel(): in case a view is set before ILabelCaptureAdvancedOverlayListener.AnchorForCapturedLabel() got called, no call to ILabelCaptureAdvancedOverlayListener.AnchorForCapturedLabel() will happen.

SetOffsetForCapturedLabel()
void SetOffsetForCapturedLabel(CapturedLabel capturedLabel, PointWithUnit offset)

Added in version 7.5.0

The method can be called to change the offset for the view associated with the given tracked label. This method is thread-safe, it can be called from any thread. The offset set via this method will take precedence over the one set via ILabelCaptureAdvancedOverlayListener.OffsetForCapturedLabel(): in case a view is set before ILabelCaptureAdvancedOverlayListener.OffsetForCapturedLabel() got called, no call to ILabelCaptureAdvancedOverlayListener.OffsetForCapturedLabel() will happen. If the MeasureUnit of the offset is MeasureUnit.Fraction, the offset is calculated relative to view’s dimensions.

SetViewForCapturedLabelField()
void SetViewForCapturedLabelField(LabelField labelField, CapturedLabel capturedLabel, View view)

Added in version 7.5.0

The method can be called to change the view drawn for the given tracked field of the captured label. Setting the view to null will unset the view from the tracked field of the captured label and will effectively remove it from the overlay. This method is thread-safe, it can be called from any thread. The view set via this method will take precedence over the one set via ILabelCaptureAdvancedOverlayListener.ViewForCapturedLabelField(): in case a view is set before ILabelCaptureAdvancedOverlayListener.ViewForCapturedLabelField() got called, no call to ILabelCaptureAdvancedOverlayListener.ViewForCapturedLabelField() will happen.

SetAnchorForCapturedLabelField()
void SetAnchorForCapturedLabelField(LabelField labelField, CapturedLabel capturedLabel, Anchor anchor)

Added in version 7.5.0

The method can be called to change the anchor point for the view associated with the given tracked field of the captured label. This method is thread-safe, it can be called from any thread. The anchor set via this method will take precedence over the one set via ILabelCaptureAdvancedOverlayListener.AnchorForCapturedLabelField(): in case a view is set before ILabelCaptureAdvancedOverlayListener.AnchorForCapturedLabelField() got called, no call to ILabelCaptureAdvancedOverlayListener.AnchorForCapturedLabelField() will happen.

SetOffsetForCapturedLabelField()
void SetOffsetForCapturedLabelField(LabelField labelField, CapturedLabel capturedLabel, PointWithUnit offset)

Added in version 7.5.0

The method can be called to change the offset for the view associated with the given tracked field of the captured label. This method is thread-safe, it can be called from any thread. The offset set via this method will take precedence over the one set via ILabelCaptureAdvancedOverlayListener.OffsetForCapturedLabelField(): in case a view is set before ILabelCaptureAdvancedOverlayListener.OffsetForCapturedLabelField() got called, no call to ILabelCaptureAdvancedOverlayListener.OffsetForCapturedLabelField() will happen. If the MeasureUnit of the offset is MeasureUnit.Fraction, the offset is calculated relative to view’s dimensions.

ClearCapturedLabelViews()
void ClearCapturedLabelViews()

Added in version 7.5.0

Clears all the views for the currently tracked labels from this overlay. This method is thread-safe, it can be called from any thread.