Rendering image Blob file in canvas ! | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 17

Rendering image Blob file in canvas !

I was trying to take user input of image and display ot to canvas but I am not able to do it. see my try ūüĎá Please tell me the solution.

22nd Sep 2021, 4:05 PM
Ayush Kumar
Ayush Kumar - avatar
4 Réponses
+ 6
You have to wait for the image to load before embedding it into the canvas. img.onload = function(){ ctx.drawImage(img,0,0,400,400); in_im.remove(); }
22nd Sep 2021, 7:28 PM
ODLNT - avatar
+ 5
šłĻ‚ﮄĄ©ŕ©ŚĽĺ i think so u should try to append in_im and remove when clicked edit: without appending it won't work so try this document.body.append(in_im); document.body.remove(in_im )
22nd Sep 2021, 4:31 PM
Pariket Thakur
Pariket Thakur - avatar
23rd Sep 2021, 3:09 AM
Nor'wester ūüƙԳŹ ūüáßūüá© (INACTIVE)
Nor'wester ūüƙԳŹ ūüáßūüá© (INACTIVE) - avatar
+ 3
That's not the actual problem. See the problem is to create image on canvas taking it from devise Time Is Money
22nd Sep 2021, 6:47 PM
Ayush Kumar
Ayush Kumar - avatar