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;

圖例:

zxing  

arrow
arrow
    文章標籤
    C# ZXing.Net 條碼
    全站熱搜

    西夏普 發表在 痞客邦 留言(0) 人氣()