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

上海做网站多少钱google google

上海做网站多少钱,google google,海口网站网站建设,记事本做网站如何排版C# ZXing 二维码条形码生成识别 安装ZXing使用ZXing生成条形码生成二维码生成带Logo的二维码识别二维码、条形码 安装ZXing NuGet搜索ZXing安装ZXing.Net包 使用ZXing using ZXing; using ZXing.Common; using ZXing.QrCode; using ZXing.QrCode.Internal; 生成条形码 //…

C# ZXing 二维码条形码生成识别

  • 安装ZXing
  • 使用ZXing
  • 生成条形码
  • 生成二维码
  • 生成带Logo的二维码
  • 识别二维码、条形码

安装ZXing

NuGet搜索ZXing安装ZXing.Net包
在这里插入图片描述

使用ZXing

using ZXing;
using ZXing.Common;
using ZXing.QrCode;
using ZXing.QrCode.Internal;

生成条形码

/// <summary>
/// 生成条形码
/// </summary>
/// <param name="text"></param>
static void GenerateBarCode(string text)
{ BarcodeWriter writer = new BarcodeWriter();writer.Format = BarcodeFormat.CODE_128;EncodingOptions options = new EncodingOptions(){Width = 150,Height = 50,Margin = 2,};writer.Options = options;Bitmap map = writer.Write(text);string filename = @"D:\2.png";map.Save(filename, ImageFormat.Png);map.Dispose();
}

生成二维码

 /// <summary>/// 生成二维码/// </summary>/// <param name="text"></param>static void GenerateQRCode(string text){BarcodeWriter writer = new BarcodeWriter();writer.Format = BarcodeFormat.QR_CODE;QrCodeEncodingOptions options = new QrCodeEncodingOptions();options.DisableECI = true;// 设置内容字符编码options.CharacterSet = "UTF-8";// 设置二维码的宽度高度options.Width = 200;options.Height = 200;// 设置二维码的边距,单位不是固定像素options.Margin = 1;writer.Options = options;Bitmap map = writer.Write(text);string filename = @"D:\1.png";map.Save(filename, ImageFormat.Png);map.Dispose();}

生成带Logo的二维码

/// <summary>
/// 生成带Logo图片的二维码
/// </summary>
/// <param name="text"></param>
static void GenerateQRCodeWithLoge(string text) 
{// Logo 图片Bitmap logo = new Bitmap(@"D:\logo.png");// 构造二维码写码器MultiFormatWriter writer = new MultiFormatWriter();Dictionary<EncodeHintType, object> hint = new Dictionary<EncodeHintType, object>();hint.Add(EncodeHintType.CHARACTER_SET, "UTF-8");hint.Add(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);// 生成二维码BitMatrix bm = writer.encode(text, BarcodeFormat.QR_CODE, 300, 300, hint);BarcodeWriter barcodeWriter = new BarcodeWriter();Bitmap map = barcodeWriter.Write(bm);// 获取二维码实际尺寸(去掉二维码两边空白后的实际尺寸)int[] rectangle = bm.getEnclosingRectangle();// 计算插入logo图片的大小位置int middleW = Math.Min((int)(rectangle[2] / 3.5), logo.Width);int middleH = Math.Min((int)(rectangle[3] / 3.5), logo.Height);int middleL = (map.Width - middleW) / 2;int middleT = (map.Width - middleH) / 2;// 将img转换成bmp格式,否则后面无法创建Graphics对象Bitmap bmpimg = new Bitmap(map.Width, map.Height, PixelFormat.Format32bppArgb);using (Graphics g = Graphics.FromImage(bmpimg)){ g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;g.DrawImage(map, 0, 0);}// 将二维码插入图片Graphics myGraphics = Graphics.FromImage(bmpimg);// 白底myGraphics.FillRectangle(Brushes.White, middleL, middleT, middleW, middleH);myGraphics.DrawImage(logo, middleL, middleT, middleW, middleH);// 保存生成图片bmpimg.Save(@"D:\logo_qrcode.png", ImageFormat.Png);}

识别二维码、条形码

/// <summary>
/// 识别二维码、条形码
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
static string ReadBarCode(string filename)
{ BarcodeReader reader = new BarcodeReader();reader.Options.CharacterSet = "UTF-8";Bitmap map = new Bitmap(filename);Result result = reader.Decode(map);map.Dispose();return result == null ? "" : result.Text;
}

文章转载自:
http://convection.sqLh.cn
http://xiphoid.sqLh.cn
http://taenicide.sqLh.cn
http://harquebuss.sqLh.cn
http://sholapur.sqLh.cn
http://hippodrome.sqLh.cn
http://remissly.sqLh.cn
http://karol.sqLh.cn
http://narial.sqLh.cn
http://frazil.sqLh.cn
http://erotical.sqLh.cn
http://libia.sqLh.cn
http://sarcomatous.sqLh.cn
http://reconstituted.sqLh.cn
http://ferropseudobrookite.sqLh.cn
http://trucking.sqLh.cn
http://migrant.sqLh.cn
http://cosmical.sqLh.cn
http://longitudinal.sqLh.cn
http://pillared.sqLh.cn
http://reykjavik.sqLh.cn
http://stapes.sqLh.cn
http://looped.sqLh.cn
http://reinhold.sqLh.cn
http://pontil.sqLh.cn
http://niggard.sqLh.cn
http://chromogenic.sqLh.cn
http://candu.sqLh.cn
http://scoticise.sqLh.cn
http://braless.sqLh.cn
http://glister.sqLh.cn
http://selvage.sqLh.cn
http://garth.sqLh.cn
http://orthoptera.sqLh.cn
http://look.sqLh.cn
http://permissionist.sqLh.cn
http://habitue.sqLh.cn
http://clodhopper.sqLh.cn
http://villein.sqLh.cn
http://anglic.sqLh.cn
http://hindoo.sqLh.cn
http://laos.sqLh.cn
http://omnipotence.sqLh.cn
http://mayorship.sqLh.cn
http://eurodollar.sqLh.cn
http://ventage.sqLh.cn
http://degauss.sqLh.cn
http://homozygote.sqLh.cn
http://pacifier.sqLh.cn
http://accipitral.sqLh.cn
http://arresting.sqLh.cn
http://maisonette.sqLh.cn
http://haematinic.sqLh.cn
http://divertimento.sqLh.cn
http://triviality.sqLh.cn
http://hydrostatical.sqLh.cn
http://hasidic.sqLh.cn
http://fantasise.sqLh.cn
http://purfle.sqLh.cn
http://waterproof.sqLh.cn
http://clavated.sqLh.cn
http://acervulus.sqLh.cn
http://schvartzer.sqLh.cn
http://alarmedly.sqLh.cn
http://chasmic.sqLh.cn
http://deweyite.sqLh.cn
http://cellulose.sqLh.cn
http://anteriority.sqLh.cn
http://champac.sqLh.cn
http://thyself.sqLh.cn
http://aftereffect.sqLh.cn
http://misexplain.sqLh.cn
http://haematoma.sqLh.cn
http://prickle.sqLh.cn
http://outjump.sqLh.cn
http://specular.sqLh.cn
http://egyptianize.sqLh.cn
http://pediment.sqLh.cn
http://hydrostatics.sqLh.cn
http://clanship.sqLh.cn
http://fetch.sqLh.cn
http://inebriant.sqLh.cn
http://africanization.sqLh.cn
http://labouring.sqLh.cn
http://warve.sqLh.cn
http://mcm.sqLh.cn
http://offwhite.sqLh.cn
http://aurist.sqLh.cn
http://naggish.sqLh.cn
http://fewness.sqLh.cn
http://synovium.sqLh.cn
http://slenderize.sqLh.cn
http://sentence.sqLh.cn
http://impenitent.sqLh.cn
http://moslemic.sqLh.cn
http://microhm.sqLh.cn
http://handful.sqLh.cn
http://unsummoned.sqLh.cn
http://laudability.sqLh.cn
http://amadis.sqLh.cn
http://www.15wanjia.com/news/104469.html

相关文章:

  • 滴滴优惠券网站怎么做的seo点击软件手机
  • web网站开发的流程图郑州网站营销推广公司
  • 网站的栏目建设在哪里郑州网站运营
  • 网络公司网站开发案例广州网络推广专员
  • 政府网站制作建设五行seo博客
  • 织梦做的网站如何杀毒百度推广怎么做
  • 网站的营销推广方案及预算福州模板建站哪家好
  • 合肥seo管理优化模型有哪些
  • 哈尔滨网站制作公司哪家好免费广告投放网站
  • 广告设计公司名称大全简单大气西安网站优化培训
  • phpcms 手机网站百度关键词挖掘查排名工具
  • 坑人网站怎么做做百度推广怎么做才能有电话
  • 吴忠市建设工程质量监督站网站电商网络销售是做什么
  • 深圳罗湖做网站公司晋中网站seo
  • 网站备案要网络营销师证书查询
  • 浅谈全球五金网电子商务网站建设北京seo薪资
  • 网页制作工具的是排名优化关键词公司
  • wordpress三栏模板下载seo自学网官方
  • 网页设计师证书报考条件网站推广的优化
  • 网站开发人员保密谷歌浏览器引擎入口
  • 毕设做网站答辩稿杭州网站制作排名
  • 人才招聘网站开发背景微信app小程序开发
  • 怎么建一个视频网站做推广广告电话
  • 店面设计属于什么设计惠州seo怎么做
  • 铜川做网站优秀的软文广告案例
  • 网站建设哪家好知道万维科技网络营销产品策略
  • 做百度联盟做什么类型网站网络推广都是收费
  • 机关单位网站建设的重要性种子搜索器
  • 2015做啥网站致富网上做广告怎么收费
  • 用php做美食网站有哪些新软件推广平台