ZXing-C++ ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library implemented in C++.
It was originally ported from the Java ZXing Library but has been developed further and now includes many improvements in terms of quality and performance. It can both read and write barcodes in a number of formats.
1D product | 1D industrial | 2D |
---|---|---|
UPC-A | Code 39 | QR Code |
UPC-E | Code 93 | DataMatrix |
EAN-8 | Code 128 | Aztec |
EAN-13 | Codabar | PDF417 |
DataBar | ITF | MaxiCode (beta) |
DataBar Expanded |
Note: DataBar used to be called RSS.
As an example, have a look at ZXingReader.cpp
.
ReadBarcode()
from ReadBarcode.h
, the simplest API to get a Result
.As an example, have a look at ZXingWriter.cpp
.
MultiFormatWriter
instance with the format you want to generate. Set encoding and margins if needed.encode()
with text content and the image size. This returns a BitMatrix
which is a binary image of the barcode where true
== visual black and false
== visual white.ToMatrix<T>(BitMatrix&)
helper function.A nuget package is available for WinRT: huycn.zxingcpp.winrt. To install it, run the following command in the Package Manager Console
PM> Install-Package huycn.zxingcpp.winrt
BUILD_...
options to enable the testing code, python wrapper, etc.wrappers/gdiplus
as source folder in the first input, specify the build output in the second input, and click on Generate.wrappers/winrt/BuildWinCom.bat
to adjust the path to your CMake installation.Note: The original Java-only ZXing project has a very good support for Android, whether you want to use it as external app via Intent or directly integrated into your app. You should consider using it first before trying this library since involving with native code is always more complex than Java-only code. Performance-wise, except for specific usecases, you won't notice the difference!
wrappers/android/jni/Application.mk
and adjust for your project.cd
into wrappers/android/jni
, type ndk-build
(or ndk-build -j <number of your CPU cores>
)libs
and java
into corresponding folders of your Android project.emcmake cmake <path to zxing-cpp.git/wrappers/wasm>
.cmake --build .
to create zxing.js
and zxing.wasm
(and _reader
/_writer
versions).emrun --serve_after_close demo_reader.html
.You can also download the latest build output from the continuous integration system from the Actions tab. Look for 'wasm-artifacts'. Also check out the live demos.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。