zxing 相关问题

ZXing(发音为“zebra crossing”)是一个用Java实现的开源,多格式1D / 2D条形码图像处理库,具有其他语言的端口。它的重点是使用手机上的内置摄像头扫描和解码设备上的条形码,而无需与服务器通信,尽管该库也支持在服务器上使用。

如何在Android App和Java Spring Boot中生成QR码? 我想在我的Android应用程序中生成QR码。由于许多流行的库已经过时并且不再可行,因此找到一个可靠的解决方案。 另外,...

是否有人建议生成QR码的可靠且最新的解决方案?理想情况下,我正在寻找一种库或方法,以确保稳定性,兼容性和易于集成。

回答 1 投票 0


ZXINGQR代码扫描仪将根据目标距离自动选择相机

Html: <zxing-scanner [device]="selectedDevice" (scanSuccess)="onQrCodeScanComplete($event)" style="width: 100%; max-height: 50vh;"> </zxing-scanner> 我的组件中有一个Zxing扫描仪的角度项目。我需要它根据您离目标的距离自动选择适当的相机。这是因为有些拥有iPhone 15 Pro的人与扫描仪没有选择相机的距离有问题。有没有一种方法可以不断自动选择正确的相机(不仅在开始时,就像默认的相机应用程序一样,因此在摄像机打开时将其调整)并将其存储在selectedDevice变量中? 您可以使用ZXing提供的内置事件来管理相机选择。 事件发出了一系列MediaDeviceInfo对象,这些对象代表可用的摄像机。您可以根据首选标签或MediaDeviceInfo对象的其他属性过滤摄像机过滤,也可以创建下拉模式以允许用户自己选择设备。然后,将其绑定到Zxing组件的(camerasFound)输入,该输入会触发OnChange。 ,您也可以使用(camerasFound)属性来防止ZXing扫描仪初始化默认摄像头,直到选择特定的设备为止。 我还建议设置[device]属性。启用自动对焦可显着提高扫描质量。 术语,您可以直接禁用Zxing AutoStart并直接从浏览器API管理设备 - 请参阅MediaDevices:getusermedia()[enable] [autofocusEnabled]="true"

回答 1 投票 0

我使用

NSError *error = nil; ZXMultiFormatWriter *writer = [ZXMultiFormatWriter writer]; ZXBitMatrix* result = [writer encode:@"A string to encode" format:kBarcodeFormatQRCode width:200 height:200 error:&error]; CGImageRef imageRef = [[ZXImage imageWithMatrix:result] cgimage]; UIImage *image = [UIImage imageWithCGImage:imageRef]; myImageView.image = image;

回答 1 投票 0

“com.google.zxing.client.android.SCAN”在 Android 中如何工作?

我使用 ZXING 库开发了一个 BarcodeScanner 应用程序。为此,我下载了完整的库并将其添加到我的项目中,并使用 URI 调用 Intent:“com.myproject.vinscan.client.android.SCAN”。但是

回答 2 投票 0

在 ngx-scanner 中使用后置摄像头时,如何选择使用哪个摄像头镜头?

我正在使用 zxing-js/ngx-scanner 在我的 Angular 应用程序中进行扫描。在三星手机中,扫描仪使用广角镜头进行扫描,这会导致扫描出现问题。 我需要能够允许...

回答 1 投票 0

使用 Flutter 实现 Google Vision API

我不确定如何将其合并到现有的 flutter 项目中,而且我在网上找不到任何有用的指南或提示。 我希望实现一个二维条码扫描仪,但没有......

回答 3 投票 0

ngx-scanner 无法在设备中工作

我正在尝试使用 ngx-scanner (https://github.com/zxing-js/ngx-scanner),但按照说明操作后它不起作用。在 PC 上可以工作,但在其他设备上则不行(手机、平板电脑...)。我有...

回答 1 投票 0

我无法使用 ZXing.Net.Maui 检测运输标签条形码

在我的 .NET Maui 8.0 移动应用程序中,我需要能够扫描条形码。我正在使用 NuGet 包 ZXing.Net.Maui。我根据他们的 Git 页面设置了一切。 我的设置 我添加了 NuGet 包...

回答 1 投票 0

C# 使用ZXING.NET解码真实图像中的QRCODE

我正在尝试读取 USB 相机获取的图像中的二维码。 在其他帖子中,我读到最好的开源库是 ZXing。 如果二维码来自数字生成的图像...

回答 2 投票 0

有人有一个可以实际运行的 JS zxing 示例吗?

@xzing/库0.17.0 节点 12.13.1 我在 jsQR 和 qrcode-reader 方面取得了一些成功,但无法让 zxing 工作。我在 http://zxing.org 上抛出的每张图像都会被解码,这让我相信 e...

回答 3 投票 0

cpp-ZXing如何生成宽字符的二维码?

#include“ReadBarcode.h” #包括 #包括 #包括 #include“BitMatrix.h” #include“BitMatrixIO.h” #包括“

回答 1 投票 0

JsBarcode不是函数,未捕获(在promise中)对象,未定义require,未定义ZXing

我无法让这段 JavaScript 代码正常工作,它一直给我错误。 这是我的代码: 我无法让这段 JavaScript 代码正常工作,它一直给我错误。 这是我的代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Barcode Generator and Scanner</title> <script src="https://cdn.jsdelivr.net/npm/jsbarcode"></script> <script src="https://unpkg.com/@zxing/browser@latest"></script> <style> body { font-family: Arial, sans-serif; margin: 20px; } .container { margin-bottom: 20px; } video { width: 100%; max-width: 400px; } svg { margin: 20px 0; } </style> </head> <body> <h1>Barcode Generator and Scanner</h1> <!-- Barcode Generator --> <div class="container"> <h2>Generate Barcode</h2> <label for="rewardsLevel">Rewards Level:</label> <select id="rewardsLevel"> <option value="1">Silver</option> <option value="2">Gold</option> <option value="3">Platinum</option> </select><br> <label for="email">Email:</label> <input type="email" id="email" placeholder="[email protected]"><br> <label for="issueDate">Issue Date:</label> <input type="date" id="issueDate"><br> <label for="name">Name:</label> <input type="text" id="name" placeholder="Your Name"><br><br> <button onclick="generateBarcode()">Generate Barcode</button> <svg id="barcode"></svg> <button id="downloadBarcode" onclick="downloadSVG()" style="display:none;">Download Barcode</button> </div> <!-- Barcode Scanner --> <div class="container"> <h2>Scan Barcode</h2> <button onclick="startScanner()">Start Scanner</button> <button onclick="resetScanner()">Reset Scanner</button> <video id="video" autoplay muted playsinline></video> <div id="decodedOutput" style="margin-top: 20px;"></div> </div> <script> // Barcode Generator function generateBarcode() { const rewardsLevel = document.getElementById("rewardsLevel").value; const email = document.getElementById("email").value; const issueDate = document.getElementById("issueDate").value.replace(/-/g, ''); const name = document.getElementById("name").value; if (!email || !issueDate || !name) { alert("Please fill in all fields."); return; } const barcodeValue = `${rewardsLevel}*${issueDate}*${email}*${name}`; const barcodeElement = document.getElementById("barcode"); JsBarcode(barcodeElement, barcodeValue, { format: "CODE128", width: 2, height: 100, displayValue: true }); document.getElementById("downloadBarcode").style.display = "block"; } // Download Barcode function downloadSVG() { const svg = document.getElementById("barcode"); const serializer = new XMLSerializer(); const source = serializer.serializeToString(svg); const blob = new Blob([source], { type: "image/svg+xml;charset=utf-8" }); const url = URL.createObjectURL(blob); const link = document.createElement("a"); link.href = url; link.download = "barcode.svg"; link.click(); URL.revokeObjectURL(url); } // Barcode Scanner let codeReader; const videoElement = document.getElementById("video"); async function startScanner() { if (!codeReader) { codeReader = new ZXing.BrowserMultiFormatReader(); } const devices = await codeReader.listVideoInputDevices(); if (devices.length === 0) { alert("No video input devices found."); return; } const selectedDeviceId = devices[0].deviceId; codeReader.decodeFromVideoDevice(selectedDeviceId, videoElement, (result, error) => { if (result) { displayDecodedData(result.text); codeReader.reset(); // Stop scanning once a code is detected } if (error) { console.error(error); } }); } function displayDecodedData(data) { const [level, date, email, name] = data.split('*'); const levels = { "1": "Silver", "2": "Gold", "3": "Platinum" }; const formattedDate = new Date(date.substring(0, 4), date.substring(4, 6) - 1, date.substring(6, 8)) .toLocaleDateString(undefined, { year: "numeric", month: "long", day: "numeric" }); const outputDiv = document.getElementById("decodedOutput"); outputDiv.innerHTML = ` <p><strong>Rewards Level:</strong> ${levels[level]}</p> <p><strong>Issue Date:</strong> ${formattedDate}</p> <p><strong>Email:</strong> ${email}</p> <p><strong>Name:</strong> ${name}</p> `; } function resetScanner() { if (codeReader) { codeReader.reset(); } videoElement.srcObject = null; document.getElementById("decodedOutput").innerHTML = ""; } </script> </body> </html> 当我运行它时,我收到这些错误: Uncaught ReferenceError: require is not defined JsBarcode.js:3:17 Uncaught (in promise) Object card:1 Uncaught (in promise) Object browser-polyfill.min.js:1 Uncaught (in promise) Object iframefallback:1 Uncaught (in promise) Object card:1 Uncaught (in promise) Object browser-polyfill.min.js:1 Uncaught TypeError: JsBarcode is not a function card:526 TypeError: JsBarcode is not a function web.assets_frontend_lazy.min.js:4107 ReferenceError: ZXing is not defined card:556 您只需要不同版本的 jsbarcode。 尝试: https://cdn.jsdelivr.net/npm/[email protected]/dist/JsBarcode.all.min.js <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Barcode Generator and Scanner</title> <!-- EDIT Replace this version of jsbarcode with the one below. <script src="https://cdn.jsdelivr.net/npm/jsbarcode"></script> --> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/JsBarcode.all.min.js"> </script> <script src="https://unpkg.com/@zxing/browser@latest"></script> <style> body { font-family: Arial, sans-serif; margin: 20px; } .container { margin-bottom: 20px; } video { width: 100%; max-width: 400px; } svg { margin: 20px 0; } </style> </head> <body> <h1>Barcode Generator and Scanner</h1> <!-- Barcode Generator --> <div class="container"> <h2>Generate Barcode</h2> <label for="rewardsLevel">Rewards Level:</label> <select id="rewardsLevel"> <option value="1">Silver</option> <option value="2">Gold</option> <option value="3">Platinum</option> </select><br> <label for="email">Email:</label> <input type="email" id="email" placeholder="[email protected]"><br> <label for="issueDate">Issue Date:</label> <input type="date" id="issueDate"><br> <label for="name">Name:</label> <input type="text" id="name" placeholder="Your Name"><br><br> <button onclick="generateBarcode()">Generate Barcode</button> <svg id="barcode"></svg> <button id="downloadBarcode" onclick="downloadSVG()" style="display:none;">Download Barcode</button> </div> <!-- Barcode Scanner --> <div class="container"> <h2>Scan Barcode</h2> <button onclick="startScanner()">Start Scanner</button> <button onclick="resetScanner()">Reset Scanner</button> <video id="video" autoplay muted playsinline></video> <div id="decodedOutput" style="margin-top: 20px;"></div> </div> <script> // Barcode Generator function generateBarcode() { const rewardsLevel = document.getElementById("rewardsLevel").value; const email = document.getElementById("email").value; const issueDate = document.getElementById("issueDate").value.replace(/-/g, ''); const name = document.getElementById("name").value; if (!email || !issueDate || !name) { alert("Please fill in all fields."); return; } const barcodeValue = `${rewardsLevel}*${issueDate}*${email}*${name}`; const barcodeElement = document.getElementById("barcode"); JsBarcode(barcodeElement, barcodeValue, { format: "CODE128", width: 2, height: 100, displayValue: true }); document.getElementById("downloadBarcode").style.display = "block"; } // Download Barcode function downloadSVG() { const svg = document.getElementById("barcode"); const serializer = new XMLSerializer(); const source = serializer.serializeToString(svg); const blob = new Blob([source], { type: "image/svg+xml;charset=utf-8" }); const url = URL.createObjectURL(blob); const link = document.createElement("a"); link.href = url; link.download = "barcode.svg"; link.click(); URL.revokeObjectURL(url); } // Barcode Scanner let codeReader; const videoElement = document.getElementById("video"); async function startScanner() { if (!codeReader) { codeReader = new ZXing.BrowserMultiFormatReader(); } const devices = await codeReader.listVideoInputDevices(); if (devices.length === 0) { alert("No video input devices found."); return; } const selectedDeviceId = devices[0].deviceId; codeReader.decodeFromVideoDevice(selectedDeviceId, videoElement, (result, error) => { if (result) { displayDecodedData(result.text); codeReader.reset(); // Stop scanning once a code is detected } if (error) { console.error(error); } }); } function displayDecodedData(data) { const [level, date, email, name] = data.split('*'); const levels = { "1": "Silver", "2": "Gold", "3": "Platinum" }; const formattedDate = new Date(date.substring(0, 4), date.substring(4, 6) - 1, date.substring(6, 8)) .toLocaleDateString(undefined, { year: "numeric", month: "long", day: "numeric" }); const outputDiv = document.getElementById("decodedOutput"); outputDiv.innerHTML = ` <p><strong>Rewards Level:</strong> ${levels[level]}</p> <p><strong>Issue Date:</strong> ${formattedDate}</p> <p><strong>Email:</strong> ${email}</p> <p><strong>Name:</strong> ${name}</p> `; } function resetScanner() { if (codeReader) { codeReader.reset(); } videoElement.srcObject = null; document.getElementById("decodedOutput").innerHTML = ""; } </script> </body> </html>

回答 1 投票 0

无法解码 Aztec 条形码

我正在尝试使用以下脚本解码 Aztec 条形码: 导入ZXING 阅读器 = zxing.BarCodeReader() 条形码 = reader.decode("test.png") 打印(条形码) 这是输入图像:

回答 2 投票 0

ZXing、Android、JetPack Compose - 在二维码周围绘制边界框

我正在 Android 中使用 Jetpack Compose 构建 QR 码扫描仪。扫描部分和读取 QR 码中的位值工作良好且符合预期。然而,作为我原型的一部分,我想要......

回答 1 投票 0

zxing库在android中不扫描二维码黑底白码(负扫描)

在我的应用程序中使用zxing库扫描二维码,但库不支持扫描黑码中的白色(负扫描),所以请建议我解决如何解决此问题。

回答 2 投票 0

xcode4“dyld:找不到符号:_OBJC_CLASS_$_AVCaptureDevice”错误

我的 iPhone 应用程序在 IOS 4.3 模拟器中运行,但不在任何其他 IOS 4.0+ 模拟器中运行。尽管如此,它还是会在那里运行。 我收到以下错误 - GNU gdb 6.3.50-20050815(苹果版 gdb-1518)(S...

回答 5 投票 0

如何使用ZXing检测复杂的二维码?

我们的团队正在使用 ZXing 3.4.0 库编写 Android 二维码扫描应用程序,我们需要扫描相当复杂的二维码,如下所示。我们测试了一下,发现扫描有些不稳定...

回答 1 投票 0

无法将ZXingObjC集成到iOS Swift项目中

我正在开发一个 iOS 项目,该项目在条形码中显示客户编号。我已经使用 CocoaPods 安装了 ZXingObjC 框架,如 GitHub 中所述。 我可以毫无错误地编译我的项目。我...

回答 5 投票 0

找不到我.sudar:zxing-orient:2.1.1

我无法在android studio Koala上编译,出现以下错误: ` 无法缓存配置缓存状态:任务 :app:mapDebugSourceSetPaths 类型 com.android 的字段 __librarySourceSets__...

回答 1 投票 0

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.