如何阅读windows phone 8.1 app开发中的二维码?

时间:2015-08-03 11:05:59

标签: c# windows-phone-8 windows-phone-8.1 qr-code

我想在Windows Phone app 8.1中扫描二维码。我尝试过很多例子,但没有人能为我工作。
下面的代码我试过但没有用

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

in xaml

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

显示如下错误:

  

命名空间中不存在名称“QRCodeScanner”   “CLR-名称空间:JeffWilcox.Controls;装配= JeffWilcox.Controls.QR”

并试过link这个也不适合我。但在这台相机中不扫描代码。
请有人帮助我。如果您有任何其他链接。我正在尝试这最后3天,但直到现在我没有得到正确答案。
Plase帮助我.......

1 个答案:

答案 0 :(得分:0)

我不推荐,但我使用Zxing 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;
}

文档和其他demoClient可用here

询问您是否需要更多代码。希望有帮助..!