Search code examples
camerawin-universal-appqr-codezxingwindows-10-universal

How to make a UWP mobile QR code reader?


I have a UWP project and I should to make a simple QR code reader at one of the pages. It is mobile application. I have trying ZXing dll, but I have no idea how to use it, becouse there is very little information available for Windows 10. Can you help me to find a good solution? UPDATE There is code, I used, and it works

private MobileBarcodeScanner _scanner; 
private async void MainPage_Loaded(object sender, RoutedEventArgs e)
{
  _scanner = new MobileBarcodeScanner(this.Dispatcher);
  _scanner.UseCustomOverlay = false;
  _scanner.TopText = "Hold camera up to QR code";
  _scanner.BottomText = "Camera will automatically scan QR code";

  var result = await _scanner.Scan();
  ProcessScanResult(result);
}

Solution

  • Try ZXing.Net 0.14.0.1, it has a Windows Runtime Component that is compatible with UWP. You can install the nuget package from here: http://www.nuget.org/packages/ZXing.Net and there's a code sample here http://zxingnet.codeplex.com/