Replies: 3 comments
-
Example pseudo code // create a canvas image with using the canvas you're going to draw on.
// NOTE if you try and draw this image on another canvas it will error
const myCanvasImage = new CanvasImage(canvas);
myCanvasImage.src = 'mybase64string';
// set up a callback for once the image is loaded
myCanvasImage.addEventListener('load', () => {
// loaded! now you can draw, etc.
context.DrawImage(myCanvasImage,0,0);
}); |
Beta Was this translation helpful? Give feedback.
-
@James-Firth thanks for the help however am getting error here is my code am trying to draw when app is loaded like using btn calling my function. however this lib seems only work to load image canva on app boot i mean u cant modify or redraw something on canva ?
|
Beta Was this translation helpful? Give feedback.
-
@darkworks Just took a quick skim, in draw_it you don't have a check to ensure Also I know the image must be drawn on the same canvas it is initialized on, otherwise you'll get an odd error. Maybe grabbing context2 is causing some issues? |
Beta Was this translation helpful? Give feedback.
-
so this is example from repo home page
so in my app i have button which create qr code and return me base64 image data so how i can write that base64 image data when qr code is generated to that above canva ?
thanks
Beta Was this translation helpful? Give feedback.
All reactions