From c9897af9caedd30b2f1402fb6ba9225434b1cd05 Mon Sep 17 00:00:00 2001 From: zhangy <287834625@qq.com> Date: Thu, 16 Feb 2023 23:19:11 +0800 Subject: [PATCH 1/2] add icon to qrcode --- README.md | 7 ++++++- index.html | 11 +++++++++-- qrcode.js | 24 +++++++++++++++++++----- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5e2d2dc6..d0b6e205 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,12 @@ var qrcode = new QRCode(document.getElementById("qrcode"), { height: 128, colorDark : "#000000", colorLight : "#ffffff", - correctLevel : QRCode.CorrectLevel.H + correctLevel : QRCode.CorrectLevel.H, + icon:{ + src:"" //image base64, + width:25, // default 20px + height:25 // default 20px + } }); ``` diff --git a/index.html b/index.html index fc16f3d9..da768698 100644 --- a/index.html +++ b/index.html @@ -8,13 +8,20 @@ -
+