Advanced Topics

This section covers detailed topics about the Anyline SDK on Windows. You will not require knowledge about these advanced topics in your every day use of the SDK. However, in case you need specific information about certain topics in the Anyline SDK, it will be covered here.

Native Barcode Scanning

Simultaneous Barcode Scanning

Windows UWP doesn’t support simultaneous barcode scanning like the other platforms, but there is an API to use real native peripheral barcode scanners, connected via USB or integrated in the device.

To enable native barcode scanning, use the following code:

Implement the native barcode scanner
public sealed partial class ScanEnergy : Page, IEnergyResultListener, INativeBarcodeResultListener
{

        NativeBarcodeScanner nativeBarcodeScanner;

        ...

        public ScanEnergy()
        {
                nativeBarcodeScanner = new NativeBarcodeScanner();
                nativeBarcodeScanner.EnableBarcodeDetection(this);

                ...
        }

        // handle barcode results
        void INativeBarcodeResultListener.OnBarcodeReceived(string barcode)
        {
                Debug.WriteLine(barcode);
                nativeBarcodeScanner.DisableBarcodeDetection();
        }
}

Choosing a different camera on your Windows device

The Anyline Windows SDK provides functionality to select the desired camera sensor - both integrated webcams or external webcams. This can be set via the PreferredCameraDevice property in the XAML code as follows:

<anyline:MrzScanView x:Name="AnylineScanView" PreferredCameraDevice="ExternalFront" />

There are 4 options for choosing the preferred camera device:

  • Back - Prefers to use the integrated back-facing device. This is the default option.
  • Front - Prefers to use the front-facing device, if there is one. The preview will be mirrored.
  • ExternalBack - Prefers to use an external camera, if there is one.
  • ExternalFront - Prefers to use an external camera, if there is one. The preview will be mirrored.

Supported camera VideoEncoding SubTypes

The Windows SDK currently only supports the following encodings for camera frame processing: ARGB32, NV12, RGB24, BGRA8, RGB32, YUV2, MJPG. Webcams may have custom encoding properties, which can lead to the fact that camera frames cannot be accessed by our SDK or the camera stream won’t be displayed correctly.

Photo Capture Listener

To use the PhotoCapture scan mode in the EnergyScanView, the easiest thing to do is to implement the IPhotoCaptureListener interface in your scan page and assign it to the Anyline scan view as follows:

AnylineScanView.PhotoCaptureListener = this;

When the scan mode is set to PhotoCapture, a button is visible that triggers the callback. You can handle the callback as follows:

public async void OnPhotoCaptured(AnylineImage anylineImage)
{
        WriteableBitmap bitmap = await anylineImage.GetBitmapAsync();

        // do something with the bitmap here..
}

Windows SDK Limitations

  • Modules - Currently, only the MRZ and Energy modules are available.
  • Architecture - Currently, the Anyline Windows SDK only supports the x86 architecture.

Known Issues

  • Flash functionality might not work on all devices despite the fact that the devices support flash. This will be fixed in the future.