Support transparent-bg QR codes

main
Charlotte Som 2023-02-13 19:41:02 +00:00
parent d8b037a15b
commit 4da495a8cc
1 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,8 @@ class QrcodeDecoder {
} }
this.gCtx!.clearRect(0, 0, width, height); 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); this.gCtx!.drawImage(target, 0, 0, width, height);
const imageData = this.gCtx!.getImageData( const imageData = this.gCtx!.getImageData(