Bit.BbScanner.Maui 11.0.0-pre-15

This is a prerelease version of Bit.BbScanner.Maui.
dotnet add package Bit.BbScanner.Maui --version 11.0.0-pre-15
                    
NuGet\Install-Package Bit.BbScanner.Maui -Version 11.0.0-pre-15
                    
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="Bit.BbScanner.Maui" Version="11.0.0-pre-15" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bit.BbScanner.Maui" Version="11.0.0-pre-15" />
                    
Directory.Packages.props
<PackageReference Include="Bit.BbScanner.Maui" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bit.BbScanner.Maui --version 11.0.0-pre-15
                    
#r "nuget: Bit.BbScanner.Maui, 11.0.0-pre-15"
                    
#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.
#:package Bit.BbScanner.Maui@11.0.0-pre-15
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bit.BbScanner.Maui&version=11.0.0-pre-15&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Bit.BbScanner.Maui&version=11.0.0-pre-15&prerelease
                    
Install as a Cake Tool

Bit.BbScanner.Maui

The device's own camera for Bit.BbScanner in a .NET MAUI Blazor Hybrid app: CameraX on Android, AVFoundation on iOS and Mac Catalyst, MediaCapture on Windows.

A Blazor Hybrid app is not a web page - .NET runs natively on the device - so the scanner does not need the WebView's camera. With this package the camera's frames go from the platform straight to the decoder, in the app's own process: the luminance plane, upright, at the camera's own resolution, decoded on a thread of its own rather than the app's UI thread. Nothing crosses into the page. The camera's native preview is drawn behind the BlazorWebView, where the scanner is, and the scanner's reticle, mask, highlights and controls are drawn over it by the page as usual.

Setup

dotnet add package Bit.BbScanner.Maui
// MauiProgram.cs
var builder = MauiApp.CreateBuilder();
builder.UseMauiApp<App>()
       .UseBbScanner();
builder.Services.AddMauiBlazorWebView();

<bb:BbScannerHost>
    <BlazorWebView HostPage="wwwroot/index.html">
        <BlazorWebView.RootComponents>
            <RootComponent Selector="#app" ComponentType="{x:Type local:Routes}" />
        </BlazorWebView.RootComponents>
    </BlazorWebView>
</bb:BbScannerHost>

The Razor does not change: <BbScanner> on a page finds the device's camera registered and uses it.

Declare the camera on each platform; the platform asks the user itself:

  • Android: <uses-permission android:name="android.permission.CAMERA" /> in AndroidManifest.xml.
  • iOS and Mac Catalyst: NSCameraUsageDescription in Info.plist, and the com.apple.security.device.camera entitlement in a sandboxed Mac Catalyst app.
  • Windows: <DeviceCapability Name="webcam" /> in Package.appxmanifest.

The preview

While a camera is open the WebView is made transparent, and the scanner and every element above it in the page paint no background, so the preview behind the WebView shows through; the BbScannerHost paints the page's own background colour behind the WebView, so the page around the scanner looks as it did. An element above the scanner that paints a colour of its own - a card the scanner sits in - shows the page's colour while the camera is open. The preview follows the scanner as the page scrolls, a frame or so behind, and is cut to whatever clips the scanner in the page: a scrolling panel it is partly scrolled out of shows the preview inside the panel only. Switching cameras keeps the page as it is in between; stopping the camera puts the WebView and the page back as they were.

Without a BbScannerHost loaded there is nowhere to draw the preview, and the scanner opens the WebView's camera instead, as it does without this package. With more than one host, a camera draws in the one loaded last, so the scanner belongs in that host's BlazorWebView.

Only the scanner's own ancestors are made transparent. Anything else the page paints under the scanner covers the preview: a scanner in a dialog shows the page content and the backdrop beneath the dialog where the camera should be. Put the scanner in the page itself - a page or a panel of its own - rather than over other content.

Documentation

The full guide is in the BbScanner README, and a working app in its MAUI sample.

Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst26.0 is compatible.  net10.0-windows10.0.19041 is compatible. 
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
11.0.0-pre-15 0 10/30/2026