1.1.1 • Published 6 years ago
canvas-qrcode-logo v1.1.1
Generate QRcode with logo, only support Canvas.
Usage
new QRCode(dom, options)NPM
npm i canvas-qrcode-logoconst QRCode = require('canvas-qrcode-logo');
new QRCode(document.getElementById("qrcode"), {
        logo: './logo.png',
        text: "https://www.xiaoboy.com",
        width: 128,
        height: 128
    });Direct Include
<script src="../qrcode.min.js"></script>
<div id="qrcode"></div>
<script type="text/javascript">
    new QRCode.default(document.getElementById("qrcode"), {
        logo: './logo.png',
        text: "https://www.xiaoboy.com",
        width: 128,
        height: 128
    });
</script>Options
- width- {Number}QRCode's width
- height- {Number}QRCode's height
- typeNumber- {Number}
- colorDark- {String}default:- #000000
- colorLight``{String}default:- #ffffff,
- correctLevel- {String}L | M | Q | H, default:- H
- logo- {String}logo's url,
- padding- {Number}white space, default: 5
- size- {Number}logo's width and height, default: 30