今天做项目的时候有个在生成二维码并且在中间加入Logo的需求,动手试了几把,总感觉效果没有之前写的好,就翻出旧代码,果然还是熟悉的味道,生成一张效果图如下 左边是微信里面的,右边是我自己生成的 原理比较简单,但细节还是有些复杂,废话不多说直接上代码 public class QRCodeHelper { public static Bitmap GetThumbnail(Bitmap b, int destHeight, int destWidth) { System.Drawing.Image…
方法一:谷歌二维码API 接口地址:https://chart.googleapis.com/chart 官方文档:https://developers.google.com/chart/infographics/docs/qr_codes 参数说明: cht=qr:必要参数,固定值<qr>,表明要生成二维码 chs=<width>x<height>:必要参数,生成二维码尺寸,单位是像素,目前生成的二维码都是正方形的,所以两个宽高值都设置为一样的值 chl=<da…
现在很多大网站都有这样的一个功能,使用手机扫描一下网页上的二维码便可快速在手机上访问网站.想要实现这样的功能其实很简单,下面麦布分享几个在线生成网址二维码的API接口.都是采用http协议接口,无需下载安装什么软件,可简单方便地引用,这才是最简单.最便捷的免费网址二维码生成工具. 在线生成网址二维码的API接口: 1.http://pan.baidu.com/share/qrcode?w=150&h=150&url=http://www.jiankangyixue.cn 2.http://…
前段时间做项目,需要动态生成一个二维码,于是就在网上找了一下发现一个jquery插件jquery.qrcode.js,所以今天就简单说一下这个插件的使用: jquery.qrcode.js是依赖jquery的,所以要先引入jquery再引入jquery.qrcode.js <script type='text/javascript' src='js/jquery.min.js'></script> <script type="text/javascript"…
传说Google有个接口,可以生成二维码,这让我有点鸡冻不已,于是,......(省略1000字).结果,我找到了另外一个方法,是使用一个php类库,该工具叫:qrcode,但下载该工具可真是要人命.不过还是下好了.qrcod官方下载地址:http://sourceforge.net/projects/phpqrcode/files/latest/download快速下载地址:http://pan.baidu.com/s/1yEPxO 以下是实现简单的二维码生成.1 <? require "…
生成二维码:参看GitHub资源https://github.com/jeromeetienne/jquery-qrcode 直接上代码:(都需要引入jQuery.js  1.引入(jquery.qrcode.min.js)或者引入下边两个文件(jquery.qrcode.js和qrcode.js)) <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>生成二…
[QRCode官网]http://phpqrcode.sourceforge.net/ PHP QRCode生成二维码 官网下载QRCode源码包,引入源码包中的 qrlib.php . <?php include "phpqrcode/qrlib.php"; QRcode::png('hys'); // png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprin…
Nuget安装ZXing.Net,帮助类: using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using ZXing; using ZXing.Common; using ZXing.QrCode; using ZXing.QrCode.Internal; namespace CommonHelper { public class BarcodeH…
public class QRCodeHelper { public static Bitmap GetThumbnail(Bitmap b, int destHeight, int destWidth) { System.Drawing.Image imgSource = b; System.Drawing.Imaging.ImageFormat thisFormat = imgSource.RawFormat; int sW = 0, sH = 0; // 按比例缩放 int sWidth…
二维条码/二维码可以分为堆叠式/行排式二维条码和矩阵式二维条码.堆叠式/行排式二维条码形态上是由多行短截的一维条码堆叠而成:矩阵式二维条码以矩阵的形式组成,在矩阵相应元素位置上用“点”表示二进制“1”,用“空”表示二进制“0”, “点”和“空”的排列组成代码. 堆叠式/行排式二维条码,如,Code 16K.Code 49.PDF417等. 矩阵式二维码,最流行莫过于QR CODE. 矩阵式二维码存储的数据量更大:可以包含数字.字符,及中文文本等混合内容:有一定的容错性(在部分损坏以后可以正常读取…