当前位置:网站首页>WinForm uses zxing to generate QR code
WinForm uses zxing to generate QR code
2022-06-29 10:31:00 【zlbcdn】
Only bar codes have been used before , Using a font library . I saw a QR code generator on the Internet this morning , Tried it , It's simple .
ZXing It's a pass Java Implementation of the open source class library , The main purpose is to generate / Analyze various bar codes , The supported encoding methods are as follows :

It supports many coding methods .
in addition , I found it on the Internet ZXing Of Demo Mostly Java Compiling , So you can also write it down winform With the implementation of the .
1、 effect


2、 Specific operation
3、 The code analysis
private void button1_Click(object sender, EventArgs e)
{
try
{
// Generate the core class of barcode , For specific related methods, please refer to the method description
var writer = new BarcodeWriter
{
Format = BarcodeFormat.QR_CODE,// The encoding type ( Enumeration type )
Options = new ZXing.Common.EncodingOptions
{
// Set the size of the barcode
Width=210,
Height=210
},
//BitMatrix
Renderer = (ZXing.Rendering.IBarcodeRenderer<Bitmap>)Activator.CreateInstance(Renderer)
};
// Generate content QR code , And show it in pictureBox On
// As for whether to save it locally or use it directly , It depends on the actual demand
this.pictureBox1.Image = writer.Write(this.textBox1.Text);
}
catch (Exception exc)
{
MessageBox.Show(this, exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}4、 Source download
边栏推荐
- 在VMware workstation中安装WMware ESXi 6.5.0并进行配置
- Talk about threads and concurrency
- 這個開源項目超哇塞,手寫照片在線生成
- Win32Exception (0x80004005): 组策略阻止了这个程序。要获取详细信息,请与系统管理员联系。
- 通过Win32API调用另一界面的按钮
- To 3 --- 最后的编程挑战
- winform使用zxing生成二维码
- 1147 Heaps (30 分)
- C#使用WinExec调用exe程序
- std::make_ shared<T>/std::make_ Unique < T> and std:: shared_ ptr<T>/std::unique_ The difference and relation between PTR < t >
猜你喜欢

1146 topological order (25 points)

520 钻石争霸赛 2021

Judgment of points inside and outside polygon

BUUCTF--reverse1

Win32Exception (0x80004005): 组策略阻止了这个程序。要获取详细信息,请与系统管理员联系。

Web漏洞手动检测分析

IIS服务器相关错误

C#窗体向另一个窗体实时传值

Function pointer, function pointer array, calculator + transfer table, etc

HDU 6778 car (group enumeration -- > shape pressure DP)
随机推荐
F5 big IP Icontrol rest command execution (cve-2022-1388)
2020-09-21 visual studio header file and Library Directory configuration
DevExpress的双击获取单元格数据
Weight recursion of complete binary tree -- the last programming challenge
1147 heaps (30 points)
Recyclerview sticky (suspended) head
September 17, 2020 gateway business process has two tasks: referer certification and non commodity Templating
2019.11.3 learning summary
2020-9-14 introduction to advertising system
Dynamic planning summary
BUUCTF--内涵的软件
Devaxpress double click to get cell data
View CSDN blog rankings
Learn spark computing framework in practice (00)
蛇形填数
I would like to know how to open an account for free online stock registration? In addition, is it safe to open a mobile account?
1147 Heaps (30 分)
2019.10.20 training summary
September 25, 2020 noncopyable of boost library for singleton mode
std::make_shared<T>/std::make_unique<T>与std::shared_ptr<T>/std::unique_ptr<T>的区别与联系