简体   繁体   English

如何在Windows Phone 8.1应用程序开发中读取QR码?

[英]How to read QR code in windows phone 8.1 app development?

I want to scan QR code in windows phone app 8.1.I am tried lot of examples but no one is work for me. 我想在Windows Phone 8.1应用中扫描QR码。我尝试了很多示例,但没有人适合我。
Below code I tried but no use 下面的代码我试过但没用

 xmlns:jwqr="clr-namespace:JeffWilcox.Controls;assembly=JeffWilcox.Controls.QR"

in xaml 在xaml中

<jwqr:QRCodeScanner
    ScanComplete="QRCodeScanner_ScanComplete"
    Error="QRCodeScanner_Error"
    Width="400"
    Height="400"/>

It showing error like: 它显示如下错误:

The name "QRCodeScanner" does not exist in the namespace "clr-namespace:JeffWilcox.Controls;assembly=JeffWilcox.Controls.QR" 名称空间“ clr-namespace:JeffWilcox.Controls; assembly = JeffWilcox.Controls.QR”中不存在名称“ QRCodeScanner”。

And tried the link this one also not working for me. 并尝试了链接,这个也对我不起作用。 But in this camera not scan the code. 但是在此相机中不扫描代码。
Please anyone help me. 请任何人帮助我。 If you have any other links. 如果您还有其他链接。 I am trying this last 3 days but till now I am not getting any answer correctly. 我最近3天都在尝试,但是到现在为止我还没有正确地得到任何答案。
Plase help me....... 请帮助我.......

I'm not recommending but i've used Zxing Library for Barcode/QR code scanning and that worked for me. 我不推荐使用,但我已经使用Zxing库进行条形码/ QR码扫描,并且对我有用

here's a sample how to use this library: 这是如何使用该库的示例:

// create a barcode reader instance
IBarcodeReader reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Bitmap.LoadFrom("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
   txtDecoderType.Text = result.BarcodeFormat.ToString();
   txtDecoderContent.Text = result.Text;
}

Documentation and other demoClient is available here 文档和其他demoClient可在此处获得

Ask if you require more code. 询问是否需要更多代码。 Hope that helps..! 希望能有所帮助..!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM