: http://zxingnet.codeplex.com/
Zxing.net is a tool for barcode and QR code under the. NET platform, which is very convenient to use.
First download the binary DLL file, introduce the project;
Using system;using system.collections.generic;using system.componentmodel;using system.data;using System.Drawing; Using system.text;using system.windows.forms;using zxing.qrcode;using zxing;using zxing.common;using ZXing.Rendering ; namespace zxingtest{public partial class Form1:form {encodingoptions options = null; Barcodewriter writer = null; Public Form1 () {InitializeComponent (); Options = new Qrcodeencodingoptions {Disableeci = true, CharacterSet = "UTF-8", Width = pictureboxqr.width, Height = pictureboxqr.height}; writer = new Barcodewriter (); Writer. Format = Barcodeformat.qr_code; Writer. options = options; The private void Buttonqr_click (object sender, EventArgs e) {if (Textboxtext.text = = string. Empty) {MessageBox.Show ("the input cannot be empty! "); ReTurn } Bitmap Bitmap = writer. Write (Textboxtext.text); Pictureboxqr.image = bitmap; } }}
Character formatting can be specified when characters are encoded, the default is iso-8859-1 English character set, but generally mobile devices commonly used UTF-8 character set encoding,
Encoding can be set by Qrcodeencodingoptions.
If you want to generate additional zxing-supported barcodes, just modify the Barcodewriter.format.
Using system;using system.collections.generic;using system.componentmodel;using system.data;using System.Drawing; Using system.text;using system.windows.forms;using zxing.qrcode;using zxing;using zxing.common;using ZXing.Rendering ; namespace zxingtest{public partial class Form1:form {encodingoptions options = null; Barcodewriter writer = null; Public Form1 () {InitializeComponent (); Options = new Encodingoptions {//disableeci = true,//characterset = "UTF-8", Width = pictureboxqr.width, Height = pictureboxqr.height}; writer = new Barcodewriter (); Writer. Format = BARCODEFORMAT.ITF; Writer. options = options; The private void Buttonqr_click (object sender, EventArgs e) {if (Textboxtext.text = = string. Empty) {MessageBox.Show ("the input cannot be empty! "); Return } Bitmap Bitmap = writer. Write (Textboxtext.text); Pictureboxqr.image = bitmap; } }}
Generate barcodes and QR codes using Google Z