Table of contents

MRZScanResult

MRZScanResult is a result class that contains the parsed MRZ information, the captured images and the result status. MRZScanner.Start returns one for every scan.

Definition

Assembly: Dynamsoft.MRZScannerBundle.Maui

Namespace: Dynamsoft.MRZScannerBundle.Maui

public class MRZScanResult

Properties

Property Type Description
Data MRZData? The parsed MRZ data.
ResultStatus EnumResultStatus The status of the result: finished, canceled or exception.
ErrorCode int The error code when the scan fails.
ErrorString string? The error message when the scan fails.

Data

The parsed MRZ information as an MRZData object. null unless the scan finished with a result.

MRZData? Data { get; }

ResultStatus

The status of the result as an EnumResultStatus.

EnumResultStatus ResultStatus { get; }
  • Finished: The scan finished.
  • Canceled: The user closed the scanner before a scan finished.
  • Exception: The scanner failed to start or failed during the scan.

ErrorCode

The error code when ResultStatus is Exception.

int ErrorCode { get; }

Remarks

  • Greater than 0: an EnumErrorCode value (range 1000–1999), such as a denied camera permission.
  • Less than 0: an error from Dynamsoft Capture Vision, such as an invalid license or template.
  • 0: an error from the MAUI layer, which has no native code. See Errors reported by the MAUI layer.

ErrorString

The error message when ResultStatus is Exception.

string? ErrorString { get; }

Methods

Method Description
GetPortraitImage Returns the detected portrait image.
GetDocumentImage Returns the cropped document image for the specified document side.
GetOriginalImage Returns the original full-frame image for the specified document side.

Each method returns an ImageData (from the Dynamsoft.Core.Maui namespace). Call ToImageSource() to show it in a MAUI Image. The conversion copies and encodes the image on the calling thread, so run it off the UI thread for large images such as the originals.

GetPortraitImage

Returns the detected portrait image extracted from the document.

ImageData? GetPortraitImage();

Return Value

The portrait image, or null if ReturnPortraitImage is false or no portrait was detected.

GetDocumentImage

Returns the cropped document image for the specified side of the document.

ImageData? GetDocumentImage(EnumDocumentSide side);

Parameter(s)

side: An EnumDocumentSide value specifying which side of the document to retrieve.

Return Value

The cropped document image, or null in the following cases:

  • ReturnDocumentImage is false.
  • EnumDocumentSide.Opposite was requested but the document is single-sided (e.g. passports).
  • EnumDocumentSide.Opposite was requested but the opposite side wasn’t captured, for example because the user finished before flipping the document.

GetOriginalImage

Returns the original full-frame camera image for the specified side of the document.

ImageData? GetOriginalImage(EnumDocumentSide side);

Parameter(s)

side: An EnumDocumentSide value specifying which side of the document to retrieve.

Return Value

The original image, or null in the following cases:

  • ReturnOriginalImage is false (the default).
  • EnumDocumentSide.Opposite was requested but the document is single-sided (e.g. passports).
  • EnumDocumentSide.Opposite was requested but the opposite side wasn’t captured.

This page is compatible for: