当前位置: 首页 > news >正文

邢台市做网站广东营销网站制作

邢台市做网站,广东营销网站制作,微信公众平台网站建设,淄川区建设局网站下载地址#xff1a;http://zxingnet.codeplex.com/ zxing.net是.net平台下编解条形码和二维码的工具#xff0c;使用非常方便。 本文主要说明一下多种类型条码的生成。 适用的场景#xff0c;标签可视化设计时#xff0c;自定义条码类型#xff0c;预览。 遍历zxing支持的… 下载地址http://zxingnet.codeplex.com/ zxing.net是.net平台下编解条形码和二维码的工具使用非常方便。 本文主要说明一下多种类型条码的生成。 适用的场景标签可视化设计时自定义条码类型预览。 遍历zxing支持的全部条码类型 if (rb rb1wm){foreach (BarcodeFormat format in Enum.GetValues(typeof(BarcodeFormat))){if (format ! BarcodeFormat.All_1D)cbxBarcodeFormat.Items.Add(format.ToString());}cbxBarcodeFormat.Items.Remove(BarcodeFormat.QR_CODE.ToString());cbxBarcodeFormat.Items.Remove(BarcodeFormat.AZTEC.ToString());cbxBarcodeFormat.Items.Remove(BarcodeFormat.DATA_MATRIX.ToString());cbxBarcodeFormat.Items.Remove(BarcodeFormat.PDF_417.ToString());}if (rb rb2wm){cbxBarcodeFormat.Items.Add(BarcodeFormat.QR_CODE.ToString());cbxBarcodeFormat.Items.Add(BarcodeFormat.AZTEC.ToString());cbxBarcodeFormat.Items.Add(BarcodeFormat.DATA_MATRIX.ToString());cbxBarcodeFormat.Items.Add(BarcodeFormat.PDF_417.ToString());}根据选择的类型生成条码 Bitmap bitmap new Bitmap(pbxBarcode.Width, pbxBarcode.Height);Graphics g Graphics.FromImage(bitmap);g.Clear(Color.White);Format (BarcodeFormat)Enum.Parse(typeof(BarcodeFormat), cbxBarcodeFormat.SelectedItem.ToString());try{var options new ZXing.Common.EncodingOptions{PureBarcode !chxDisplayBarcode.Checked};#region 根据条码类型Write Image switch (Format){case BarcodeFormat.QR_CODE:#region QRCodeif (cbxErrorLevel.SelectedItem.ToString().Equals(L))ErrorCorrectionLevel QR_ErrorCorrectionLevel.L;if (cbxErrorLevel.SelectedItem.ToString().Equals(H))ErrorCorrectionLevel QR_ErrorCorrectionLevel.H;if (cbxErrorLevel.SelectedItem.ToString().Equals(M))ErrorCorrectionLevel QR_ErrorCorrectionLevel.M;if (cbxErrorLevel.SelectedItem.ToString().Equals(Q))ErrorCorrectionLevel QR_ErrorCorrectionLevel.Q;ErrorCorrectionLevel level null;switch (ErrorCorrectionLevel){case QR_ErrorCorrectionLevel.H:level ZXing.QrCode.Internal.ErrorCorrectionLevel.H;break;case QR_ErrorCorrectionLevel.M:level ZXing.QrCode.Internal.ErrorCorrectionLevel.M;break;case QR_ErrorCorrectionLevel.L:level ZXing.QrCode.Internal.ErrorCorrectionLevel.L;break;case QR_ErrorCorrectionLevel.Q:level ZXing.QrCode.Internal.ErrorCorrectionLevel.Q;break;}QrCodeEncodingOptions qr_options new QrCodeEncodingOptions{Margin 0,DisableECI true,CharacterSet UTF-8,ErrorCorrection level,PureBarcode !chxDisplayBarcode.Checked,Width pbxBarcode.Width,Height pbxBarcode.Height};var qrWriter new ZXing.BarcodeWriter();qrWriter.Format BarcodeFormat.QR_CODE;qrWriter.Options qr_options;#endregionbitmap qrWriter.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(qrWriter.Options, Format, bitmap);break;case BarcodeFormat.PDF_417:#region PDF417PDF417EncodingOptions pdf_options new PDF417EncodingOptions{Margin 0,DisableECI true,CharacterSet UTF-8,Width pbxBarcode.Width,Height pbxBarcode.Height,PureBarcode !chxDisplayBarcode.Checked};var pdf417Writer new ZXing.BarcodeWriter();pdf417Writer.Format BarcodeFormat.PDF_417;pdf417Writer.Options pdf_options;#endregionbitmap pdf417Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(pdf417Writer.Options, Format, bitmap);break;case BarcodeFormat.DATA_MATRIX:#region DataMatrixDatamatrixEncodingOptions dataMatrix_options new DatamatrixEncodingOptions{Margin 0,SymbolShape (ZXing.Datamatrix.Encoder.SymbolShapeHint)(Enum.Parse(typeof(ZXing.Datamatrix.Encoder.SymbolShapeHint), cbxDataMatrixOption.SelectedItem.ToString())),Width pbxBarcode.Width,Height pbxBarcode.Height,PureBarcode !chxDisplayBarcode.Checked,};var dataMatrixWriter new ZXing.BarcodeWriter();dataMatrixWriter.Format BarcodeFormat.DATA_MATRIX;dataMatrixWriter.Options dataMatrix_options;#endregionbitmap dataMatrixWriter.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(dataMatrixWriter.Options, Format, bitmap);break;case BarcodeFormat.AZTEC:#region AztecZXing.Aztec.AztecEncodingOptions aztecEncodingOptions new ZXing.Aztec.AztecEncodingOptions{Margin 0,ErrorCorrection 2,PureBarcode !chxDisplayBarcode.Checked,Layers 16};var aztecWriter new ZXing.BarcodeWriter();aztecWriter.Format BarcodeFormat.AZTEC;aztecWriter.Options aztecEncodingOptions;#endregionbitmap aztecWriter.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(aztecWriter.Options, Format, bitmap);break;case BarcodeFormat.CODE_128:#region Code128ZXing.OneD.Code128EncodingOptions code128_options new ZXing.OneD.Code128EncodingOptions{Margin 0,PureBarcode !chxDisplayBarcode.Checked,Width pbxBarcode.Width,Height pbxBarcode.Height,ForceCodesetB true};var code128_Writer new ZXing.BarcodeWriter();code128_Writer.Format BarcodeFormat.CODE_128;code128_Writer.Options code128_options;#endregionbitmap code128_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(code128_Writer.Options, Format, bitmap);break;case BarcodeFormat.CODABAR:var codeBar_Writer new ZXing.BarcodeWriter();codeBar_Writer.Format BarcodeFormat.CODABAR;codeBar_Writer.Options options;bitmap codeBar_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;case BarcodeFormat.EAN_13:var ean13_Writer new ZXing.BarcodeWriter();ean13_Writer.Format BarcodeFormat.EAN_13;ean13_Writer.Options options;bitmap ean13_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;case BarcodeFormat.EAN_8:var ean8_Writer new ZXing.BarcodeWriter();ean8_Writer.Format BarcodeFormat.EAN_8;ean8_Writer.Options options;bitmap ean8_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;case BarcodeFormat.CODE_39:var code39_Writer new ZXing.BarcodeWriter();code39_Writer.Format BarcodeFormat.CODE_39;code39_Writer.Options options;bitmap code39_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;case BarcodeFormat.UPC_A:var upca_Writer new ZXing.BarcodeWriter();upca_Writer.Format BarcodeFormat.UPC_A;upca_Writer.Options options;bitmap upca_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;case BarcodeFormat.UPC_E:var upce_Writer new ZXing.BarcodeWriter();upce_Writer.Format BarcodeFormat.UPC_E;upce_Writer.Options options;bitmap upce_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;case BarcodeFormat.MSI:var msi_Writer new ZXing.BarcodeWriter();msi_Writer.Format BarcodeFormat.MSI;msi_Writer.Options options;bitmap msi_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;case BarcodeFormat.ITF:var itf_Writer new ZXing.BarcodeWriter();itf_Writer.Format BarcodeFormat.ITF;itf_Writer.Options options;bitmap itf_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;case BarcodeFormat.PLESSEY:var plessey_Writer new ZXing.BarcodeWriter();plessey_Writer.Format BarcodeFormat.PLESSEY;plessey_Writer.Options options;bitmap plessey_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;case BarcodeFormat.MAXICODE:var code_Writer new ZXing.BarcodeWriter();code_Writer.Format BarcodeFormat.MAXICODE;code_Writer.Options options;bitmap code_Writer.Write(tbxBarcodeValue.Text.Trim());BarCodeOptionsChanged?.Invoke(options, Format, bitmap);break;default:throw new Exception(条码格式暂不支持);}#endregion}catch (Exception ex){MessageBox.Show(编码生成错误 ex.Message, 系统提示, MessageBoxButtons.OK, MessageBoxIcon.Error);}finally{pbxBarcode.Image bitmap;}转载于:https://www.cnblogs.com/datacool/p/datacool_2017_zxing.html
http://www.zqtcl.cn/news/735574/

相关文章:

  • 外贸网站排行榜前十名电影网站标题怎么做流量多
  • 网站建设吉金手指专业13网站备案完成后不解析
  • 社保网站减员申报怎么做长春建筑网站
  • 网站开发用原生wordpress读者墙
  • 食品网站网页设计成都建网页
  • 网站建设 珠海专业团队表情包张伟
  • 建设铝合金窗网站.net制作网站开发教程
  • 网站后台服务器内部错误wordpress 多级菜单
  • 怎样更新网站内容怎么查看网站是哪家公司做的
  • 建设网站网站建站建立一个网站平台需要多少钱
  • 学校网站模板 html网站建设技术路线
  • 图片网站如何做百度排名深入挖掘wordpress
  • 网站建设的前景网站建设分为哪三部分
  • 房地产公司网站下载校园二手信息网站建设
  • 有关网站空间不正确的说法是设计和建设企业网站心得和体会
  • 个人网站前置审批项怎么做投票 网站
  • 网站建设零金手指花总js源码下载从哪个网站能下载
  • 网站开发属于无形资产两人合伙做网站但不准备开公司
  • 五大类型网站网站建设投标文件
  • 崇明区建设镇网站装修公司网站制作
  • 哪些网站可以做房产推广呼家楼街道网站建设
  • 微网站怎么开通萝岗手机网站建设
  • 牙科医院网站开发内江市住房和城乡建设局网站电话号码
  • 网站建设的想法和意见芜湖的网站建设公司
  • 效果好的网站建设wordpress主题基础
  • html5建设摄影网站意义crm免费客户管理系统
  • win2008 建立网站网站策划书的撰写流程
  • 德泰诺网站建设百度网盘资源搜索引擎入口
  • 谁能给个网站谢谢wordpress 主题 后门
  • 学校网站建设目的seo教学免费课程霸屏