Support transparent-bg QR codes

This commit is contained in:
Charlotte Som 2023-02-13 19:41:02 +00:00
parent d8b037a15b
commit 4da495a8cc

View file

@ -48,6 +48,8 @@ class QrcodeDecoder {
}
this.gCtx!.clearRect(0, 0, width, height);
this.gCtx!.fillStyle = "#ffffff";
this.gCtx!.fillRect(0, 0, width, height);
this.gCtx!.drawImage(target, 0, 0, width, height);
const imageData = this.gCtx!.getImageData(