Documentation / MRZ Scanner 1.x (archive) / Xamarin
On this page
- SetScannerType
- ResumeScanning
- void set(string dateFormat)
- Set the date format in which the parsed dates are formatted.
- @return the currently set date format in which the parsed dates are formatted. @param dateFormat the pattern describing the date format. Example: "dd.MM.yyyy"
- SdkVersion
- SetIDActive
- SetPassportActive
- SetVisaActive
- SetMaxThreads
- setZoomFactor
- RegisterWithLicenseKey
- ScanImage
- ScanBitmap
- ScanFromGallery
- SetScanningRectangle
SetScannerType
Specify which scanner type you want to use. There are two options: "MRZ Scanner" and "Document Image scanner".
The "MRZ Scanner" option is used to scan for MRZ.
The "Document image scanner" is used for capturing front and back image of the ID documents.
@param scannerType [ScannerTypeMrz, ScannerTypeDocImageId, ScannerTypeDocImagePassport]. Default value is ScannerTypeMrz
void SetScannerType(ScannerType scannerType)
ResumeScanning
Resume scanning after the scanner has been paused/stopped. Usually after a successful scan.
static void ResumeScanning()
void set(string dateFormat)
Set the date format in which the parsed dates are formatted.
@return the currently set date format in which the parsed dates are formatted.
@param dateFormat the pattern describing the date format. Example: "dd.MM.yyyy"
string dateFormat = "dd.MM.yyyy";
void set(string dateFormat) {
MRZScanner.DateFormat = dateFormat;
}
SdkVersion
@return the current SDK Version.
static string SdkVersion()
SetIDActive
Specify whether the scanner should detect and return results for IDs.
@param isIDActive [true, false]. The default value is true.
static void SetIDActive(bool isIDActive)
SetPassportActive
Specify whether the scanner should detect and return results for passports.
@param isPassportActive [true, false]. The default value is true.
static void SetPassportActive(bool isPassportActive)
SetVisaActive
Specify whether the scanner should detect and return results for visas.
@param isVisaActive [true, false]. Default value is true.
static void SetVisaActive(bool isVisaActive)
SetMaxThreads
Specify the maximum number of CPU threads that the scanner can use during the scanning process.
@param maxThreads number of CPU threads. The default value is 2.
static void SetMaxThreads(int maxThreads)
setZoomFactor
Set the zoom factor for the camera preview.
@param float. Default value is 1.0
void SetZoomFactor(float zoomFactor)
RegisterWithLicenseKey
Register with the licence key provided to remove the asterisks (*) from the result.
@param context the activity's context.
@param key the provided licence key.
@return 0 for success, -1 if registration failed.
static int RegisterWithLicenseKey(Context context, string key)
To get your evaluation key today, register an account on https://mrzscanner.com/register
ScanImage
Scan a single image. (iOS Only)
@param image The UIImage to be scanned.
@return The result data model.
static MRZResultDataModel ScanImage(UIIMage image)
ScanBitmap
Scan for a single bitmap. (Android Only)
@param bitmap the image to be scanned.
@param activity the initialisation activity context.
@param listener result listener.
static void ScanBitmap(Bitmap bitmap, Activity activity, IMRZScannerListener listener)
ScanFromGallery
Trigger an image picker.
@param activity the initialisation activity context.
@param listener result listener
static void ScanFromGallery(Activity activity, IMRZScannerListener listener)
SetScanningRectangle
Set the scanning rectangle to limit the scanning area. The parameters' values are representing percentages of the scanning preview.
@param x the top-left point of the scanning rectangle. [0,...,100] Default value: 5.
@param y the top-left point of the scanning rectangle. [0,...,100] Default value: 20.
@param width the width of the scanning rectangle. [0,...,100] Default value: 90.
@param height the height of the scanning rectangle. [0,...,100] Default value: 60.
void SetScanningRectangle(int x, int y, int width, int height)
Updated Jun 18, 2024 · Questions? Ask us