引入zxing.dll

using System;
using System.Drawing;
using ZXing.QrCode;
using ZXing;
using ZXing.Common; namespace NKO_Printer_Core
{
public class BarcodeHelper
{
/// <summary>
/// 返回生成的Bitmap对象
/// </summary>
/// <param name="barcodeContent">条码内容</param>
/// <param name="barcodeFormat">条码格式</param>
/// <param name="height">条码高度</param>
/// <param name="width">宽度高度</param>
/// <returns></returns>
public static Bitmap CreateBarcode(string barcodeContent,BarcodeFormat barcodeFormat,int height,int width)
{
try
{
BarcodeWriter writer = new BarcodeWriter();
EncodingOptions options = new QrCodeEncodingOptions
{
DisableECI = true,
CharacterSet = "UTF-8",
Width = height,
Height = width
};
writer.Options = options;
writer.Format = barcodeFormat;
return writer.Write(barcodeContent); }
catch (Exception e)
{
return null;
}
}
}
}

 下载zxing.dll

zxing.dll生成条码的更多相关文章

  1. C#+ZXing.dll生成手机路径导航二维码

    1.原谅我先写点废话哈 这两天用C#写一个C端的软件,甲方提出一个很无理的需求(在C端的程序中实现路径导航,关键是这个程序最终是运行在物理隔绝的电脑上的……),头疼了好几天,领导突然想到可以把坐标+百 ...

  2. ZXing.dll 生成二维码 C# winform net4.5

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  3. C# .Net 使用zxing.dll生成二维码,条形码

    public static string GetBarcode(string format, string value, int? width, int? height)        {       ...

  4. C# 利用BarcodeLib.dll生成条形码(一维,zxing,QrCodeNet/dll二维码)

    原文:http://blog.csdn.net/kongwei521/article/details/17588825 首先效果: 一.下载BarcodeLib.dll 下载地址 :http://do ...

  5. C# 利用BarcodeLib.dll生成条形码

    首先效果: 1:首先下载BarcodeLib.dll 下载地址 http://pan.baidu.com/share/link?shareid=2590968386&uk=2148890391 ...

  6. zxing .net 多种条码格式的生成

    下载地址:http://zxingnet.codeplex.com/ zxing.net是.net平台下编解条形码和二维码的工具,使用非常方便. 本文主要说明一下多种类型条码的生成. 适用的场景,标签 ...

  7. C# - VS2019调用ZXing.NET实现条码、二维码和带有Logo的二维码生成

    前言 C# WinFrm程序调用ZXing.NET实现条码.二维码和带有Logo的二维码生成. ZXing.NET导入 GitHub开源库 ZXing.NET开源库githib下载地址:https:/ ...

  8. 译:c#生成条码的web控件

    译文:http://www.codeproject.com/Tips/846860/Csharp-Barcode-Generator-Web-Control 在asp.net的web页用c#的web控 ...

  9. C#利用Zxing.net生成条形码和二维码并实现打印的功能

        开篇:zxing.net是.net平台下编解条形码和二维码的工具. 下载地址:http://pan.baidu.com/s/1kTr3Vuf Step1:使用VS2010新建一个窗体程序项目: ...

随机推荐

  1. hdoj 4548 美素数

    美素数 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submiss ...

  2. url 中文编解码

    unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System ...

  3. [OC Foundation框架 - 2] NSString 的创建

    A. 不可变字符串 void stringCreate() { //Don't need to release memory by this way NSString *str1 = @"S ...

  4. 为什么只有在用Visual Studio启动程序时会抛出InvalidOperationException异常

    博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:为什么只有在用Visual Studio启动程序时会抛出InvalidOperationExceptio ...

  5. Centos 7 yum 安装Apache

    1.首先查看是否已经安装 rpm    -qa    httpd 2.如果没有 yum     install      httpd      -y rpm    -ql    httpd  查看 3 ...

  6. HDU 5500 Reorder the Books 贪心

    Reorder the Books Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...

  7. 【转】如何在vmware中如何设置ip

    如何在vmware中如何设置ip 1.修改网络接口选hostonly2.虚拟机里安装vmware-tool,对鼠标和图形进行更好地支持.如果你在图形界面下,首先要切换到文本模式.右键点击桌面,打开一个 ...

  8. XMLHTTP使用具体解释

    XMLHTTP对象是Microsoft的MSXML开发包中带的一个用HTTP,XML协议訪问web资源的对象. 从MSXML3.0開始出现. 它在AJAX技术中主要用来从其它网络资源获取信息,然后由j ...

  9. Android中Touch事件分析--解决HorizontalScrollView滑动和按钮事件触发问题

    之前写过关于HorizontalScrollView滑动和按钮事件触发问题,但是不能所有的情况,最近几天一直在想这个问题,今天有一个比较好的解决思路,最终应用在项目里面效果也很好,首先说明一下功能: ...

  10. Memcached source code analysis -- Analysis of change of state--reference

    This article mainly introduces the process of Memcached, libevent structure of the main thread and w ...