Code Monkey home page Code Monkey logo

qrcode's Introduction

二维码实例及相关知识简介

二维码应用实例

二维码的生成细节和原理

AlphaTr/jquery-qrcode 修改而来

文档参考

二维码编码($.fn.QREncode

######使用 $('canvas').QREncode(config),具体配置参看下文。 参数格式:

配置 config 参数可以是一个对象或者字符串,字符串时会将字符串用默认参数生成二维码,为对象时候,参数如下:

  • text String 生成二维码的文字,默认值为 "QRCode";

  • render String 渲染方式,默认使用 Canvas 元素渲染;

  • bgColor String 背景色,格式如 "#ADFC23" 或 "#234", 默认值 "#FFF";

  • moduleColor String 前景色,(即色块的颜色)如上,默认值 "#000";

注意:前景色要比背景色深,对比要大;

  • moduleSize Integer 色块大小,默认 5px;

  • mode Integer 编码方式,默认使用 8bits;

  • ECLevel Integer 纠错码等级,默认为 30%;

  • margin Integer 四周留白倍数,默认为色块大小的 4 倍(也是推荐大小);

  • logo String 中间的 Logo,默认为空,不渲染 Logo,如果渲染强制使用最高纠错级别;

  • error Function 报错函数,默认空函数,接收错误异常对象。

二维码解码($.fn.QRDecode

######使用 $('canvas').QRDecode(error),选择器取到的是绘有二维码的 canvas 元素。

qrcode's People

Contributors

nuintun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.