Capture.Vision.Maui 2.0.0

dotnet add package Capture.Vision.Maui --version 2.0.0
NuGet\Install-Package Capture.Vision.Maui -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Capture.Vision.Maui" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Capture.Vision.Maui --version 2.0.0
#r "nuget: Capture.Vision.Maui, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Capture.Vision.Maui as a Cake Addin
#addin nuget:?package=Capture.Vision.Maui&version=2.0.0

// Install Capture.Vision.Maui as a Cake Tool
#tool nuget:?package=Capture.Vision.Maui&version=2.0.0

.NET MAUI Camera View with Dynamsoft Vision SDKs

The project's goal is to assist developers in creating .NET MAUI applications featuring a custom camera view. It utilizes Dynamsoft Vision SDKs for barcode, MRZ (Machine Readable Zone), and document detection.


  • Windows

    .NET MAUI Windows QR code scanner

  • iOS

    .NET MAUI iOS: detect barcode, document and mrz

Demo Video: .NET MAUI QR Code Scanner

Supported Platforms

  • Android
  • iOS
  • Windows


  • Read 1D barcodes, QR codes, PDF417, DataMatrix, and other formats from camera frames.
  • Recognize Machine Readable Zones (MRZ) from camera frames.
  • Detect document edges within camera frames.

Getting Started

  1. Enable the camera view in MauiProgram.cs:

  2. Request a free trial license and replace LICENSE-KEY with your own license key in the platform-specific code.

    App.xaml.cs for Windows:

    using Dynamsoft;
    using Microsoft.UI.Xaml;
    namespace Capture.Vision.Maui.Example.WinUI
        public partial class App : MauiWinUIApplication
            public App()

    MainActivity.cs for Android:

    using Android.App;
    using Android.Content.PM;
    using Android.OS;
    using Dynamsoft;
    namespace Capture.Vision.Maui.Example
        public class MainActivity : MauiAppCompatActivity
            protected override void OnCreate(Bundle savedInstanceState)
                // Your platform-specific code here
                MrzScanner.InitLicense("LICENSE-KEY", this);

    Program.cs for iOS:

    using ObjCRuntime;
    using UIKit;
    using Dynamsoft;
    static void Main(string[] args)
        UIApplication.Main(args, null, typeof(AppDelegate));
  3. Create a content page to add the camera view:

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns=""
                <cv:CameraView x:Name="cameraView" HorizontalOptions="FillAndExpand"
                VerticalOptions="FillAndExpand" EnableBarcode="True" EnableDocumentDetect="True" EnableMrz="True"
                                    ResultReady="cameraView_ResultReady" FrameReady="cameraView_FrameReady"
                <skia:SKCanvasView x:Name="canvasView" 
                            HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
                            PaintSurface="OnCanvasViewPaintSurface" />

    Set EnableBarcode, EnableDocumentDetect, and EnableMrz to activate barcode, document, and MRZ (Machine Readable Zone) detection, respectively. Use the cameraView_ResultReady event to retrieve the results.

    private void cameraView_ResultReady(object sender, ResultReadyEventArgs e)
        if (e.Result is BarcodeResult[])
        else if (e.Result is DocumentResult)
        else if (e.Result is MrzResult)

Custom Image Processing

In the cameraView_FrameReady event, you can access the camera frame for custom image processing.

private void cameraView_FrameReady(object sender, FrameReadyEventArgs e)
    // process image

The FrameReadyEventArgs provide the image buffer, width, height, stride and format.

public class FrameReadyEventArgs : EventArgs
    public enum PixelFormat
    public FrameReadyEventArgs(byte[] buffer, int width, int height, int stride, PixelFormat pixelFormat)
        Buffer = buffer;
        Width = width;
        Height = height;
        Stride = stride;
        Format = pixelFormat;

    public byte[] Buffer { get; private set; }
    public int Width { get; private set; }
    public int Height { get; private set; }
    public int Stride { get; private set; }
    public PixelFormat Format { get; private set; }

Currently, frames captured from Windows and Android devices are in the GRAYSCALE format, whereas frames from iOS devices use the BGRA8888 format.

Barcode Parameters Configuration

Configure the barcode detection parameters to suit specific scenarios and requirements. This includes adjusting settings for barcode types, scanning precision, and other relevant factors.

public CameraPage()
    // cameraView.BarcodeParameters = "{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\", \"BF_ONED\"], \"ExpectedBarcodesCount\":20}}";


Building NuGet Package from Source Code

cd Capture.Vision.Maui
dotnet build --configuration Release
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-android33.0 is compatible.  net7.0-ios was computed.  net7.0-ios16.1 is compatible.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net7.0-windows10.0.19041 is compatible.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 213 3/6/2024
1.4.0 138 1/24/2024
1.3.0 83 1/23/2024
1.2.1 100 1/17/2024
1.2.0 89 1/17/2024
1.1.0 110 1/5/2024
1.0.0 307 6/19/2023

- Added document detection and mrz detection for ios