Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/satrong/canvas-qrcode-logo
Generate QRcode with logo, only support Canvas.
https://github.com/satrong/canvas-qrcode-logo
qrcode qrcode-generator
Last synced: about 2 months ago
JSON representation
Generate QRcode with logo, only support Canvas.
- Host: GitHub
- URL: https://github.com/satrong/canvas-qrcode-logo
- Owner: satrong
- Created: 2019-06-09T08:32:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-05T09:20:19.000Z (over 5 years ago)
- Last Synced: 2024-10-09T09:53:51.704Z (3 months ago)
- Topics: qrcode, qrcode-generator
- Language: JavaScript
- Homepage: https://satrong.github.io/canvas-qrcode-logo/demo/
- Size: 52.7 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> Generate QRcode with logo, only support Canvas.
# Usage
```js
new QRCode(dom, options)
```## NPM
```shell
npm i canvas-qrcode-logo
``````js
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
```html
<script src="../qrcode.min.js">new QRCode.default(document.getElementById("qrcode"), {
logo: './logo.png',
text: "https://www.xiaoboy.com",
width: 128,
height: 128
});```
# 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