V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
jwangkun
V2EX  ›  问与答

有没有二维码生成源码?

  •  
  •   jwangkun · 2014-08-06 18:20:17 +08:00 · 4020 次点击
    这是一个创建于 3550 天前的主题,其中的信息可能已经有所发展或是发生改变。
    有没有二维码生成源码?由于最近公司想做基于二维码的开发,和定制功能,目前市场上有没有成型的源码或者免费API接口?有做过相关的Ver给点建议!
    8 条回复    2016-09-23 10:53:14 +08:00
    fbzl
        1
    fbzl  
       2014-08-06 18:31:14 +08:00   ❤️ 1
    janxin
        2
    janxin  
       2014-08-06 18:35:21 +08:00   ❤️ 1
    omi4399
        3
    omi4399  
       2014-08-06 19:56:26 +08:00
    墙外用 google chart

    墙内 http://www.liantu.com/
    66450146
        4
    66450146  
       2014-08-06 20:09:39 +08:00   ❤️ 1
    xarrow
        5
    xarrow  
       2014-08-06 23:16:35 +08:00   ❤️ 1
    zxing
    frankzeng
        6
    frankzeng  
       2014-08-07 12:04:45 +08:00
    php用phpqrcode
    xarrow
        7
    xarrow  
       2014-08-09 15:45:36 +08:00   ❤️ 1
    <pre>
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using ThoughtWorks.QRCode.Codec;
    using ThoughtWorks.QRCode.Codec.Data;

    namespace WindowsFormsApplication2
    {
    //构造类
    class QRCode {
    //构造方法
    public QRCode(PictureBox pic)
    {
    //实例化
    ThoughtWorks.QRCode.Codec.QRCodeEncoder coder = new QRCodeEncoder();
    //编码方法
    coder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;
    //大小
    coder.QRCodeScale = 25;
    //版本
    coder.QRCodeVersion = 0;
    //纠错码等级
    // QR码有容错能力,QR码图形如果有破损,仍然可以被机器读取内容,
    //最高可以到7%~30%面积破损仍可被读取。所以QR码可以被广泛使用在运输外箱上。

    //相对而言,容错率愈高,QR码图形面积愈大。所以一般折衷使用15%容错能力。
    //错误修正容量
    //L水平 7%的字码可被修正
    //M水平 15%的字码可被修正
    //Q水平 25%的字码可被修正
    //H水平 30%的字码可被修正
    coder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M;

    string str = "Hello,World";

    /*建议使用UTF8 编码,提供中文
    QR码数据容量
    数字 最多7,089字符
    字母 最多4,296字符
    二进制数(8 bit) 最多2,953 字节
    日文汉字/片假名 最多1,817字符(采用Shift JIS)
    中文汉字 最多984字符(采用UTF-8)
    中文汉字 最多1,800字符(采用BIG5)
    */
    System.Drawing.Bitmap b = coder.Encode(str.ToString(), Encoding.UTF8);
    Image i = b;

    //Object o = System.Reflection.Missing.Value;

    pic.Image = b;
    pic.SizeMode = PictureBoxSizeMode.Zoom;
    }

    }
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    QRCode qr = new QRCode(pictureBox1);


    }
    }
    }

    </pre>

    以前用C#写的,比较乱..
    jiane
        8
    jiane  
       2016-09-23 10:53:14 +08:00
    联图的二维码在线生成 API : https://www.juhe.cn/docs/api/id/189
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3847 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:09 · PVG 13:09 · LAX 22:09 · JFK 01:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.