Coder Social home page Coder Social logo

Comments (7)

hrbonz avatar hrbonz commented on September 28, 2024 2

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.

DarthSonic avatar DarthSonic commented on September 28, 2024

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.

arunned avatar arunned commented on September 28, 2024

Did you resolve this issue?

from kjua.

DarthSonic avatar DarthSonic commented on September 28, 2024

No. Switched to a server side QrCode generator.

from kjua.

qroft avatar qroft commented on September 28, 2024

I am having the same problem. Currently trying to switch to SVG but still not success.

from kjua.

benneic avatar benneic commented on September 28, 2024

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.

unbreakmat avatar unbreakmat commented on September 28, 2024

i can confirm what @hrbonz says works
this topic can be closed now

from kjua.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.