Rectangular Viewfinder

Defined under the namespace Scandit.Datacapture.Core.Ui

RectangularViewfinderStyle

Added in version 6.8.0

The style of the RectangularViewfinder.

Legacy

Added in version 6.8.0

Legacy style from versions before 6.8.

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

Square

Added in version 6.8.0

New style from version 6.8 onwards with square corners.

Rounded

Added in version 6.8.0

New style from version 6.8 onwards with rounded corners.

RectangularViewfinderLineStyle

Added in version 6.8.0

The style of the lines drawn as part of the RectangularViewfinder for all styles except RectangularViewfinderStyle.Legacy.

Bold

Added in version 6.8.0

Draws lines with a width of 5 dips/points.

Light

Added in version 6.8.0

Draws lines with a width of 3 dips/points.

RectangularViewfinder
class RectangularViewfinder : Viewfinder

Added in version 6.1.0

Rectangular viewfinder with an embedded Scandit logo. The rectangle is always centered on the point of interest of the view.

The rectangular viewfinder is displayed when the recognition is active and hidden when it is not.

To use this viewfinder, create a new instance and assign it to the overlay, e.g. the barcode capture overlay via the BarcodeCaptureOverlay.viewfinder property.

constructor(style, lineStyle)
constructor(style: RectangularViewfinderStyle,
        lineStyle: RectangularViewfinderLineStyle)

Added in version 6.8.0

Constructs a new rectangular viewfinder with the specified style and line style.

constructor(style)
constructor(style: RectangularViewfinderStyle)

Added in version 6.8.0

Constructs a new rectangular viewfinder with the specified style and RectangularViewfinderLineStyle.Light.

constructor()
constructor()

Added in version 6.1.0

Constructs a new rectangular viewfinder with RectangularViewfinderStyle.Legacy and RectangularViewfinderLineStyle.Light.

style
get style(): RectangularViewfinderStyle

Added in version 6.8.0

The style of the viewfinder.

lineStyle
get lineStyle(): RectangularViewfinderLineStyle

Added in version 6.8.0

The style of the viewfinder’s lines. Not available for RectangularViewfinderStyle.Legacy.

color
color: Color

Added in version 6.1.0

The color used to draw the logo and viewfinder when the mode is enabled. The color is always used at full opacity, changing the alpha value has no effect.

disabledColor
disabledColor: Color

Added in version 6.11.0

The color used to draw the logo and viewfinder when the mode is disabled. By default transparent.

dimming
dimming: number

Added in version 6.8.0

The amount the area outside the viewfinder’s rectangle is dimmed by. Accepts values between 0 (no dimming) and 1 (fully blacked out). Not available for RectangularViewfinderStyle.Legacy.

disabledDimming
disabledDimming: number

Added in version 6.11.0

The amount the area outside the viewfinder’s rectangle is dimmed by when the mode is disabled. Accepts values between 0 (no dimming) and 1 (fully blacked out). Not available for RectangularViewfinderStyle.Legacy.

animation
animation: RectangularViewfinderAnimation | null

Added in version 6.8.0

The animation used for the viewfinder, if any. Not available for RectangularViewfinderStyle.Legacy.

sizeWithUnitAndAspect
get sizeWithUnitAndAspect(): SizeWithUnitAndAspect

Added in version 6.1.0

The size and sizing mode of the viewfinder.

setSize(size)
setSize(size: SizeWithUnit): void

Added in version 6.1.0

Sets the horizontal and vertical size of the viewfinder to the provided value. When the unit is relative (unit in either x or y is MeasureUnit.Fraction) the size is computed relative to the view size minus the scan area margins.

setWidthAndAspectRatio(width, heightToWidthAspectRatio)
setWidthAndAspectRatio(width: NumberWithUnit,
        heightToWidthAspectRatio: number): void

Added in version 6.1.0

Sets the width of the viewfinder and compute height automatically based on the provided height/width aspect ratio. When the unit is relative (MeasureUnit.Fraction), the width is computed relative to the view size minus the scan area margins.

setHeightAndAspectRatio(height, widthToHeightAspectRatio)
setHeightAndAspectRatio(height: NumberWithUnit,
        widthToHeightAspectRatio: number): void

Added in version 6.1.0

Sets the height of the viewfinder and compute width automatically based on the provided width/height aspect ratio. When the unit is relative (MeasureUnit.Fraction), the height is computed relative to the view size minus the scan area margins.

setShorterDimensionAndAspectRatio(fraction, aspectRatio)
setShorterDimensionAndAspectRatio(fraction: number,
        aspectRatio: number): void

Added in version 6.8.0

Sets the viewfinder size on the short side of the scan area as fraction of the scan area size. The size on the long side is calculated based on the provided short side/long side aspectRatio.