Comments (7)
If you look at the demo, the code is a bit more clear. I do it the following way:
let imgBuffer = new Image;
// add logo to QR code
imgBuffer.src = 'img/my-logo.svg';
let QR = kjua({
image: imgBuffer,
mSize: 20,
mPosX: 50,
mposY: 50,
});
from kjua.
Container element is: <div id="qrcode-wa" class="text-right p-b-xs" style="width: 100%; min-width: 96px; max-width: 96px;"></div>
from kjua.
Did you resolve this issue?
from kjua.
No. Switched to a server side QrCode generator.
from kjua.
I am having the same problem. Currently trying to switch to SVG but still not success.
from kjua.
I think you might be providing the wrong object in the 'image' parameter (i.e. not a string but an element). Looking at the code, specifically the method call to ctx.drawImage
this is a canvas element, so the values you can provide for image
param are:
image
An element to draw into the context. The specification permits any canvas image source (CanvasImageSource), specifically, a CSSImageValue, an HTMLImageElement, an SVGImageElement, an HTMLVideoElement, an HTMLCanvasElement, an ImageBitmap, or an OffscreenCanvas.
Source: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage
from kjua.
i can confirm what @hrbonz says works
this topic can be closed now
from kjua.
Related Issues (19)
- 5px to much height HOT 5
- Object.assign is not defined in IE11 HOT 2
- Releases HOT 1
- Minified script contains "Function" eval HOT 1
- Unable to add image HOT 5
- Add STEEM and BITSHARES crypto please! HOT 1
- Object.assign on safari 8.0.3 HOT 2
- Feature request: adjustable color of squares HOT 1
- 建议增加logo边框
- Changeable content HOT 3
- New line in QR code content HOT 1
- Safari throws a CORS error HOT 2
- Different size qr code HOT 2
- Dependencies badge shows error/404 page HOT 1
- Readme: Bower link links to GitHub
- Generate SVG? HOT 18
- Update copyright date
- Resize QR code on the fly? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kjua.