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

云尚网站建设东莞服务行业推广软件

云尚网站建设,东莞服务行业推广软件,网站的登陆注册页面怎么做,关于做膳食的一些网站ZXing是一个开源Java类库用于解析多种格式的1D/2D条形码。目标是能够对QR编码、Data Matrix、UPC的1D条形码进行解码。 其提供了多种平台下的客户端包括#xff1a;J2ME、J2SE和Android。 首先#xff0c;在其官网http://code.google.com/p/zxing/上去下载源码 编译在其cshar… ZXing是一个开源Java类库用于解析多种格式的1D/2D条形码。目标是能够对QR编码、Data Matrix、UPC的1D条形码进行解码。 其提供了多种平台下的客户端包括J2ME、J2SE和Android。 首先在其官网http://code.google.com/p/zxing/上去下载源码 编译在其csharp目录下打开zxing.csproj文件新建一个工程。在编译之前修改两个错误   源代码中有两处UTF-8的问题会导致乱码 其一com.google.zxing.qrcode.encoder.encoder类中的 internal const System.String DEFAULT_BYTE_MODE_ENCODING ISO-8859-1; 此处将ISO-8859-1改为UTF-8 其二com.google.zxing.qrcode.decoder.DecodedBitStreamParser类的成员 private const System.String UTF8 UTF8; 应将UTF8改为UTF-8   修改完之后点重新生成编译出新的dll文件。 将zxing.dll考入到你自己所需要的工程中并添加引用。 这样自己就可以试用了主要是二维码的生成和识别两个用处   二维码的生成 using com.google.zxing.qrcode; using com.google.zxing; using com.google.zxing.common; using ByteMatrix com.google.zxing.common.ByteMatrix; using EAN13Writer com.google.zxing.oned.EAN13Writer; using EAN8Writer com.google.zxing.oned.EAN8Writer; using MultiFormatWriter com.google.zxing.MultiFormatWriter; private void button1_Click(object sender, EventArgs e) {string content textBox1.Text; ByteMatrix byteMatrix new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, 200, 200); Bitmap bitmap toBitmap(byteMatrix); pictureBox1.Image bitmap; //writeToFile(byteMatrix, System.Drawing.Imaging.ImageFormat.Png, sFD.FileName); //SaveFileDialog sFD new SaveFileDialog(); //sFD.DefaultExt *.png|*.png; //sFD.AddExtension true; //try //{ // if (sFD.ShowDialog() DialogResult.OK) // { // } //} //catch (Exception ex) //{ // MessageBox.Show(ex.Message); //}} public static void writeToFile(ByteMatrix matrix, System.Drawing.Imaging.ImageFormat format, string file) { Bitmap bmap toBitmap(matrix); bmap.Save(file, format); } public static Bitmap toBitmap(ByteMatrix matrix) { int width matrix.Width; int height matrix.Height; Bitmap bmap new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); for (int x 0; x width; x) { for (int y 0; y height; y) { bmap.SetPixel(x, y, matrix.get_Renamed(x, y) ! -1 ? ColorTranslator.FromHtml(0xFF000000) : ColorTranslator.FromHtml(0xFFFFFFFF)); } } return bmap; } 二维码的读取识别 private void button1_Click(object sender, EventArgs e) { if (this.openFileDialog1.ShowDialog() ! DialogResult.OK) { return; } Image img Image.FromFile(this.openFileDialog1.FileName); Bitmap bmap; try { bmap new Bitmap(img); } catch (System.IO.IOException ioe) { MessageBox.Show(ioe.ToString()); return; } if (bmap null) { MessageBox.Show(Could not decode image); return; } LuminanceSource source new RGBLuminanceSource(bmap, bmap.Width, bmap.Height); com.google.zxing.BinaryBitmap bitmap new com.google.zxing.BinaryBitmap(new COMMON.HybridBinarizer(source)); Result result; try { result new MultiFormatReader().decode(bitmap); } catch(ReaderException re) { MessageBox.Show(re.ToString()); return; } MessageBox.Show(result.Text); }  转载于:https://www.cnblogs.com/hnsongbiao/p/9145285.html
http://www.sadfv.cn/news/47191/

相关文章:

  • 手机网站好处需要做网站的企业电话
  • 网站收录入口申请查询高端html5网站建设的思路
  • 网站开发tornado上海网站建设公司网站建设
  • 网站源码可以做淘宝客橙色大气风格网站模板
  • 网站开发在线学习后端网站开发
  • 长沙营销型网站建设制作小说推广怎么做
  • 怎么做付款下载网站果女做拍的视频网站
  • 什么直播可以做游戏视频网站吗哪些网站是做食品
  • 合肥建立网站自己做视频用什么软件
  • 长春教做网站带维护的培训机构做英语quiz的网站
  • 安庆迎江区建设局网站有没有专门做教育培训的网站
  • 网站标题导航栏中国十大建设集团
  • 可以免费搭建网站吗丰南建设网站
  • 网站 掌握青岛核酸检测最新消息
  • 怎么查网站的外链网站电话素材
  • 河北网站快速排名建设用网站做自我介绍
  • 南通市住房和建设局网站网站建设的基本内容
  • gif图片动态素材网站劳务网站有做吗
  • 中国建站公司自己安装wordpress
  • 图案设计网站推荐全国设计网站建设
  • 利用软件做许多网站违法吗如何修改上线网站
  • 电子商务网站的开发语言网站宣传
  • 上鼎工程建设有限公司网站建筑业管理平台登录
  • 水库信息化网站建设网站建设王滨1983
  • 牡丹江 网站建设app平台运营模式
  • 东莞网站推广大全如何做好网站建设内容的策划书
  • 哪个网站能学做微商中装建设股票
  • 好的装修网站网站建设属于哪个行业分类
  • 聚美联盟网站怎么做商城系统源码开发软件
  • 做网站公司郑州郑州的网站建设公司找网站设计公司