Javascript 二维码阅读库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7733975/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 03:22:45  来源:igfitidea点击:

Javascript QR code reading libraries

javascriptcordovaqr-code

提问by Alec Wenzowski

I wish to use QR codes in a PhoneGap-based mobile app. There are several ways to generate QR codes using javascript. I'm using Jerome Etienne's jquery-based solution.

我希望在基于PhoneGap的移动应用程序中使用二维码。有几种方法可以使用 javascript 生成二维码。我正在使用Jerome Etienne 的基于 jquery 的解决方案

I'm looking for a pure Javascript solution or a set of PhoneGap plugins for the camera-enabled platformsthat will read QR encoded data in an image.

我正在为支持摄像头的平台寻找一个纯 Javascript 解决方案或一组 PhoneGap 插件,这些平台将读取图像中的 QR 编码数据。

So far all I've found is a demo by LazarSoft. Are there any other solutions?

到目前为止,我发现的只是LazarSoft 的一个演示。还有其他解决方案吗?

采纳答案by Bijan

This is the current go to library for barcode scanning: https://github.com/wildabeast/BarcodeScanner

这是当前用于条码扫描的库:https: //github.com/wildabeast/BarcodeScanner

Now the official cross-platform BarcodeScanner for Cordova / PhoneGap https://github.com/phonegap/phonegap-plugin-barcodescanner

现在官方跨平台 BarcodeScanner for Cordova / PhoneGap https://github.com/phonegap/phonegap-plugin-barcodescanner

回答by asbjornenge

UPDATEI finally put up my demousing jsqrcode. Try it here.

更新我终于使用 jsqrcode展示了我的演示在这里试试。

These http://www.webqr.com/guys have actually ported the ZXing qrcode scanner to javascript https://github.com/LazarSoft/jsqrcode!!

这些http://www.webqr.com/ 的家伙实际上已经将 ZXing 二维码扫描器移植到了 javascript https://github.com/LazarSoft/jsqrcode!!

The only thing you need the flash thing for is to use the webcam (in their examples). The javascript decode and detection works on canvas elements.

你唯一需要闪光灯的是使用网络摄像头(在他们的例子中)。javascript 解码和检测适用于画布元素。

I'm currently using the HTML5 Camera API and the javascript bits from LazarSoft to detect and decode QR codes in the browser. Pure web :-D

我目前正在使用 HTML5 相机 API 和 LazarSoft 的 javascript 位来检测和解码浏览器中的二维码。纯网络:-D

For desktop testing set the Enable MediaStream flag under chrome:flags, or get the camera bundled client from Opera Labs http://snapshot.opera.com/labs/camera/

对于桌面测试,在 chrome:flags 下设置 Enable MediaStream 标志,或从 Opera Labs http://snapshot.opera.com/labs/camera/获取相机捆绑客户端

回答by Paul Beusterien

See also this Tutorialwhich shows how to make a PhoneGap app using the Barcode Scanner pluginthat uses the Zebra Crossing library

另请参阅此教程,其中展示了如何使用使用Zebra Crossing 库Barcode Scanner 插件制作 PhoneGap 应用程序

回答by Uilian

This one looks nice. According with their own description:

这个看起来不错。根据他们自己的描述:

Using Lazar Laszlo's port of ZXing Java library, QCodeDecoder brings to the web a great interface for dealing with QRCode decoding, being usable both on desktops and mobile phones.

使用 Lazar Laszlo 的 ZXing Java 库端口,QCodeDecoder 为 Web 带来了一个用于处理 QRCode 解码的出色界面,可在台式机和手机上使用。

Demo: http://cirocosta.github.io/qcode-decoder/

演示:http: //cirocosta.github.io/qcode-decoder/

Repository: https://github.com/cirocosta/qcode-decoder

存储库:https: //github.com/cirocosta/qcode-decoder