+ 1

Canvas

How to add image in canvas

24th Jan 2019, 3:51 AM
Praveen Lakra
Praveen Lakra - avatar
1 Answer
+ 1
Try this: var img = new Image(); img.onload = function() { context.drawImage(img, x, y); }; img.src = "example.jpg"; The x and y coordinates are where to insert the image, "example.jpg" is a link to the image.
24th Jan 2019, 4:56 AM
Š˜Š³Š¾Ń€ŃŒ ŠÆŠŗŠ¾Š²ŠµŠ½ŠŗŠ¾
Š˜Š³Š¾Ń€ŃŒ ŠÆŠŗŠ¾Š²ŠµŠ½ŠŗŠ¾ - avatar