canvas-qrcode-logo
v1.1.1
Published
Generate QRcode with logo, only support Canvas.
Downloads
13
Readme
Generate QRcode with logo, only support Canvas.
Usage
new QRCode(dom, options)
NPM
npm i canvas-qrcode-logo
const 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 widthheight
{Number}
QRCode's heighttypeNumber
{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: 5size
{Number}
logo's width and height, default: 30