-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logo support #100
Comments
I just implemented this function, and the QR Code is decoded just fine : function drawLogo() {
var ctx = canvas.getContext("2d");
var logoWidth = logo.width;
var logoHeight = logo.height;
var width = qr.size / 3;
var height = logoHeight / logoWidth * width;
var x = (qr.size / 2) - (width / 2);
var y = (qr.size / 2) - (height / 2);
var maskPadding = qr.size / 30;
ctx.globalCompositeOperation = 'destination-out';
ctx.drawImage(logo, 0, 0, logoWidth, logoHeight, x - maskPadding, y - maskPadding, width + (maskPadding * 2), height + (maskPadding * 2));
ctx.globalCompositeOperation = 'source-over';
ctx.drawImage(logo, 0, 0, logoWidth, logoHeight, x, y, width, height);
} Of course, this works for my case, but other options could be provided (i.e. |
is there a way one can add an image to the qr being printed? |
+1 |
|
Still no update after 5 years? |
Since the project hasn't been updated in 5 years, it seems like maybe @neocotic abandoned it? |
the guys must create a PR to be validated. |
I think no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be nice to be able to add some logo to the QR code. If the code becomes unreadable falls to the scope of another project 😄
The text was updated successfully, but these errors were encountered: