Captured Field

Defined in namespace Scandit.DataCapture.Label.Data

LabelField
class LabelField : IDisposable

Added in version 8.1.0

Represents a captured field within a label. Each field corresponds to a specific data element defined in the LabelDefinition and contains the actual captured data along with metadata about its state, location, and type.

Fields can be either barcode fields (containing Barcode data) or text fields (containing string data), and may include additional semantic information such as parsed dates.

Processing captured fields:

Name
string Name { get; }

Added in version 8.1.0

The unique identifier for this captured field within the label. This name corresponds to the field name specified in the LabelDefinition when configuring the label structure. For example, field names might be “barcode”, “price”, “expiry_date”, etc.

Type
LabelFieldType Type { get; }

Added in version 8.1.0

Identifies the type of the captured field type. This either returns LabelFieldType.Barcode, or LabelFieldType.Text. Depending on the type, further information such as captured data is available through the following properties:

PredictedLocation
Quadrilateral PredictedLocation { get; }

Added in version 8.1.0

The predicted location of this field within the image, represented as a quadrilateral with four corner points. These coordinates are in image space and need to be converted to view coordinates before they can be used for UI overlays. When the field’s State is LabelFieldState.Unknown, a quadrilateral with all points set to (0,0) is returned.

State
LabelFieldState State { get; }

Added in version 8.1.0

The current state of this field in the capture process. This indicates whether the field has been successfully captured, its location has been predicted, or it remains unknown:

Required
bool Required { get; }

Added in version 8.1.0

Indicates whether this field is required for the label to be considered complete. Returns true for mandatory fields and false for optional fields. This value is determined by the isOptional property set in the corresponding field definition.

Barcode
Barcode Barcode { get; }

Added in version 8.1.0

The decoded barcode data for this field. This property contains the full barcode information including the decoded data, symbology, and location. Returns null when the field type is not LabelFieldType.Barcode or when the barcode hasn’t been successfully captured yet.

Text
string Text { get; }

Added in version 8.1.0

The recognized text content for this field. This property contains the raw text string extracted through OCR processing. Returns null when the field type is not LabelFieldType.Text or when the text hasn’t been successfully captured yet.

Date
LabelDate Date { get; }

Added in version 8.1.0

The parsed date information for this field, if applicable. Returns a LabelDate containing structured date components (day, month, year) when the field content can be parsed as a date using the LabelDateFormat specified in the field definition. Returns null if the field is not a date field or if parsing fails.