Smart Camera Component Pixelnetica™ Document Scanning SDK for .NET MAUI
The Smart Camera component enables document scanning using the device camera with built-in guidance for better capture quality.
This component can be integrated into the application interface as a View
.
- Class:
ImageSdkWrapper.Forms.PxlScannerView
Events:
PictureReceiver
– returns a scanned image or error.CloseClicked
– triggered if the user cancels scanning.
Usage examples are provided in the demo app, under CameraMainPage.xaml.cs
.
p.PictureReceiver = MyPictureReceiver;
void MyPictureReceiver(MetaImage img, string errorTextOrNull)
{
if (img == null)
{
Console.WriteLine(errorTextOrNull);
}
else
{
// Handle scanned image
}
}
Smart Camera Detectors
The Smart Camera includes three detectors that interactively analyze the viewfinder to prevent common mistakes:
ShakeDetection
– avoids blurred images caused by device shaking.DocumentArea
– ensures the document occupies a sufficient portion of the frame.TrapezoidDistortion
– detects and warns about perspective distortion.
These detectors can be disabled (e.g., to improve scanning speed):
ImageSdkWrapper.Forms.Camera.Settings.DocumentArea = false;
Customization Properties
Bottom toolbar
Color PanelBackgroundColor
Thickness PanelPadding
Thickness CloseButtonPadding
double ButtonsSize
double CloseButtonsSize
Safe area padding
Thickness SafeAreaPadding
– recommended for devices with non-standard screen shapes.
Shutter button
double ShotButtonSize
Color ShotButtonBorderColor
Camera status display
double StateTextVerticalDiv
Color StateBackgroundColor
Color StateTextColor
Thickness StateTextPadding
double StateTextFontSize
Localization
Camera messages can be localized by editing static strings in the demo app (CameraMainPage.xaml.cs
):
Msg.shot_busy = "Camera busy";
Msg.shot_not_stable = "Camera is shaking";
Msg.looking_for_document = "Looking for document";
Msg.small_area = "Move camera closer to document";
Msg.distorted = "Hold camera parallel to document";
Msg.unstable = "Don't move camera";