Rectangular Viewfinder#
Defined in package com.scandit.datacapture.core.ui.viewfinder
-
RectangularViewfinder
# class RectangularViewfinder
: ViewfinderAdded in version 6.0.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 by assigning to the BarcodeCaptureOverlay.viewfinder property.
-
RectangularViewfinder()
# RectangularViewfinder
()Added in version 6.0.0
-
color
# int
getColor
()void
setColor
(int
value)Added in version 6.0.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
# int
getDisabledColor
()void
setDisabledColor
(int
value)Added in version 6.3.0
The color used to draw the logo and viewfinder when the mode is disabled. By default transparent.
-
sizeWithUnitAndAspect
# @NonNull SizeWithUnitAndAspect
getSizeWithUnitAndAspect
()Added in version 6.0.0
The size and sizing mode of the viewfinder.
-
setSize(size)
# void
setSize
(@NonNull SizeWithUnit size)Added in version 6.0.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)
# void
setWidthAndAspectRatio
(@NonNull FloatWithUnit width,float
heightToWidthAspectRatio)Added in version 6.0.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)
# void
setHeightAndAspectRatio
(@NonNull FloatWithUnit height,float
widthToHeightAspectRatio)Added in version 6.0.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.
-