Bit.BbScanner.Maui
11.0.0-pre-15
dotnet add package Bit.BbScanner.Maui --version 11.0.0-pre-15
NuGet\Install-Package Bit.BbScanner.Maui -Version 11.0.0-pre-15
<PackageReference Include="Bit.BbScanner.Maui" Version="11.0.0-pre-15" />
<PackageVersion Include="Bit.BbScanner.Maui" Version="11.0.0-pre-15" />
<PackageReference Include="Bit.BbScanner.Maui" />
paket add Bit.BbScanner.Maui --version 11.0.0-pre-15
#r "nuget: Bit.BbScanner.Maui, 11.0.0-pre-15"
#:package Bit.BbScanner.Maui@11.0.0-pre-15
#addin nuget:?package=Bit.BbScanner.Maui&version=11.0.0-pre-15&prerelease
#tool nuget:?package=Bit.BbScanner.Maui&version=11.0.0-pre-15&prerelease
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" />inAndroidManifest.xml. - iOS and Mac Catalyst:
NSCameraUsageDescriptioninInfo.plist, and thecom.apple.security.device.cameraentitlement in a sandboxed Mac Catalyst app. - Windows:
<DeviceCapability Name="webcam" />inPackage.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 | Versions 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. |
-
net10.0-android36.0
- Bit.BbScanner (>= 11.0.0-pre-15)
- Microsoft.AspNetCore.Components.WebView.Maui (>= 10.0.120)
- Microsoft.Maui.Controls (>= 10.0.120)
- Xamarin.AndroidX.Camera.Camera2 (>= 1.5.3.1)
- Xamarin.AndroidX.Camera.Lifecycle (>= 1.5.3.1)
- Xamarin.AndroidX.Camera.View (>= 1.5.3.1)
-
net10.0-ios26.0
- Bit.BbScanner (>= 11.0.0-pre-15)
- Microsoft.AspNetCore.Components.WebView.Maui (>= 10.0.120)
- Microsoft.Maui.Controls (>= 10.0.120)
-
net10.0-maccatalyst26.0
- Bit.BbScanner (>= 11.0.0-pre-15)
- Microsoft.AspNetCore.Components.WebView.Maui (>= 10.0.120)
- Microsoft.Maui.Controls (>= 10.0.120)
-
net10.0-windows10.0.19041
- Bit.BbScanner (>= 11.0.0-pre-15)
- Microsoft.AspNetCore.Components.WebView.Maui (>= 10.0.120)
- Microsoft.Maui.Controls (>= 10.0.120)
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 |