ZXing生成二维码
2016-05-23 13:50
369 查看
dll:http://files.cnblogs.com/files/jake-ge/ZXing.rar
引入命名空间
using System.Drawing;
using System.IO;
using ZXing;
using ZXing.Common;
引入命名空间
using System.Drawing;
using System.IO;
using ZXing;
using ZXing.Common;
public byte[] GenBarCode(string Contents) { EncodingOptions options = new EncodingOptions(); BarcodeWriter writer = null; options.Width = 50; options.Height = 50; writer = new BarcodeWriter(); writer.Format = BarcodeFormat.QR_CODE; writer.Options = options; Bitmap bitmap = writer.Write(Contents); MemoryStream ms = new MemoryStream(); bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); byte[] bytes = ms.GetBuffer(); ms.Close(); return bytes; }
相关文章推荐
- Yii2 $app总结
- AndroidA——背景选择器selector用法汇总(一)
- 蓝桥杯基础试题 兰顿蚂蚁
- ACM--几何––圆––角速度--HDOJ 1593--find a way to escape
- 关于The serializable class XXX does not declare a static final serialVersionUID field of type long的警告
- Android 面试题总结之Android 基础(一)
- Memcached安装&常规错误&监控
- 初学OBjective-C 编程心得
- thinkphp解决分页后序列号自增的问题
- Android的体系结构
- OpenCV2.4.X怎样使开发出来的exe文件或软件可独立运行?
- 高通Android平台硬件调试之Camera
- 测试
- 微信分享
- Android——listview android:cacheColorHint,android:listSelector属性作用
- 沈梦黑发骗子骗术揭秘
- Python中set与frozenset方法和区别详解
- SQL集合运算(转载)
- Android Studio The APK file does not exist on disk
- java实验八 网络编程 (无脑实验系列)