close
1.前言:
ZXing.Net是一個Apache License 2.0的開放函式庫,可以輕鬆地製作一維及二維條碼,讓專案報表開發更快速。
2.說明:
ZXing.Net的說明及軟體下載網址:
http://zxingnet.codeplex.com/
條碼解碼支援類型:
UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 93, Code 128, ITF, Codabar, MSI, RSS-14 (all variants), QR Code, Data Matrix, Aztec and PDF-417.
條碼編碼支援類型:
UPC-A, EAN-8, EAN-13, Code 39, Code 128, ITF, Codabar, Plessey, MSI, QR Code, PDF-417, Aztec, Data Matrix
本範例使用版本為ZXing.Net.0.12.0.0
軟體解壓縮後,將\ZXing.Net.0.12.0.0\net3.5\zxing.dll的DLL檔複製到自己專案的bin目錄下
加入參考: zxing.dll
加入命名空間:
using ZXing;
程式碼:
//範例一: 產生QRCode BarcodeWriter bw = new BarcodeWriter(); bw.Format = BarcodeFormat.QR_CODE; bw.Options.Width = 260; bw.Options.Height = 237; Bitmap bitmap = bw.Write("PIXNET"); pictureBox1.Image = (Image)bitmap; //範例二: 產生Code128 BarcodeWriter bw = new BarcodeWriter(); bw.Format = BarcodeFormat.CODE_128; bw.Options.Width = 200; bw.Options.Height = 100; bw.Options.PureBarcode = false; Bitmap bitmap = bw.Write("PIXNET"); pictureBox1.Image = (Image)bitmap;
圖例:
文章標籤
全站熱搜