zxing.dll用于生成条码/二维码

时间:2021-11-02 02:49:16
【文件属性】:
文件名称:zxing.dll用于生成条码/二维码
文件大小:203KB
文件格式:ZIP
更新时间:2021-11-02 02:49:16
zxing 条码生成 二维码生成 直接添加引用zxing.dll,调用如下方法生成Bitmap然后可以打印或显示出来: private Bitmap GetQRCodeByZXingNet(String strMessage, Int32 width, Int32 height) { Bitmap result = null; try { BarcodeWriter barCodeWriter = new BarcodeWriter(); barCodeWriter.Format = BarcodeFormat.CODE_128; barCodeWriter.Options.Hints.Add(EncodeHintType.CHARACTER_SET, "UTF-8"); barCodeWriter.Options.Hints.Add(EncodeHintType.ERROR_CORRECTION, ZXing.QrCode.Internal.ErrorCorrectionLevel.H); barCodeWriter.Options.Height = height; barCodeWriter.Options.Width = width; barCodeWriter.Options.Margin = 0; ZXing.Common.BitMatrix bm = barCodeWriter.Encode(strMessage); result = barCodeWriter.Write(bm); } catch (Exception ex) { //异常输出 MessageBox.Show(ex.Message); } return result; }
【文件预览】:
zxing.dll

网友评论