Barcode AR Responsive Annotation
Defined in namespace Scandit.DataCapture.Barcode.Ar.UI
- BarcodeArResponsiveAnnotation
class BarcodeArResponsiveAnnotation : IBarcodeArAnnotation
Added in version 8.0.0
Responsive annotations dynamically switch between different annotation variations based on the barcode’s size relative to the screen. This allows for different display styles as a barcode gets closer to or further from the camera.
Each variation is gated by an area-ratio upper bound (the barcode area as a percentage of the screen area). The variations are evaluated from far to close, and the one whose upper bound is the first at or above the current ratio is displayed.
Each variation is a BarcodeArInfoAnnotation, BarcodeArPopoverAnnotation or BarcodeArStatusIconAnnotation, and any can be set to null to display nothing in that range.
Note
Passing a BarcodeArResponsiveAnnotation as a variation of another BarcodeArResponsiveAnnotation is undefined behavior and is not supported.
Note
A BarcodeArPopoverAnnotation is not fully supported as a variation. BarcodeArView only applies popover-specific handling — dark scrim, exclusive visibility, hiding on tap — to a popover the annotation provider returns directly, so a popover used as a variation does not receive it.
- BarcodeArResponsiveAnnotation()
BarcodeArResponsiveAnnotation(Barcode barcode, IDictionary<
float, IBarcodeArAnnotation> annotationsByThreshold)Added in version 8.7.0
Constructs a new responsive annotation whose displayed variation depends on the barcode’s area relative to the view. Each key is the area-ratio upper bound (in the range (0.0, 1.0]) at or below which the associated annotation is shown; ranges are evaluated from far to close. A key of 1.0 covers the entire view, so include one to cover the closest range. A null value suppresses the annotation in that range, and keys outside (0.0, 1.0] are ignored.
Note
Passing a BarcodeArResponsiveAnnotation as a value in
annotationsByThresholdis undefined behavior and is not supported.
- BarcodeArResponsiveAnnotation()
BarcodeArResponsiveAnnotation(Barcode barcode, BarcodeArInfoAnnotation closeUpAnnotation, BarcodeArInfoAnnotation farAwayAnnotation)
Added in version 8.0.0
Constructs a new responsive annotation with the given barcode and annotation variations.
Deprecated since version 8.7: Replaced by the constructor that accepts an
annotationsByThresholdmap, which supports any number of distance-based variations. Will be removed in 9.0.
- AnnotationsByThreshold
IDictionary<
float, IBarcodeArAnnotation> AnnotationsByThreshold { get; }Added in version 8.7.0
The annotations keyed by the area-ratio upper bound (in (0.0, 1.0]) at or below which each is shown, with null for a range that shows nothing. Keys passed to the initializer outside (0.0, 1.0] are dropped.
- Threshold
static
floatThreshold { get;set; }Added in version 8.0.0
The threshold (percentage of the barcode area vs screen area) that determines when to display close-up vs far-away annotations.
The value should be between 0.0 and 1.0, where 0.1 represents 10% of the screen area.
The default value is 0.05.
Note
The threshold is a class-level property that applies to all instances of BarcodeArResponsiveAnnotation.
Deprecated since version 8.7: Configure per-instance distance ranges with the
annotationsByThresholdmap instead. Setting it has no effect on an annotation constructed with anannotationsByThresholdmap. Will be removed in 9.0.
- AnnotationTrigger
BarcodeArAnnotationTrigger AnnotationTrigger { get;set; }
Added in version 8.0.0
The trigger that causes the annotation to be presented. By default is BarcodeArAnnotationTrigger.HighlightTapAndBarcodeScan.
- CloseUpAnnotation
BarcodeArInfoAnnotation CloseUpAnnotation { get; }
Added in version 8.6.0
The annotation displayed when the barcode appears close-up (when the barcode area exceeds the Threshold).
Can be null to display nothing for close-up barcodes.
Deprecated since version 8.7: Use AnnotationsByThreshold instead. Will be removed in 9.0.
- FarAwayAnnotation
BarcodeArInfoAnnotation FarAwayAnnotation { get; }
Added in version 8.6.0
The annotation displayed when the barcode appears far away (when the barcode area is below or equal to the Threshold).
Can be null to display nothing for far-away barcodes.
Deprecated since version 8.7: Use AnnotationsByThreshold instead. Will be removed in 9.0.