0

Loading images onto canvas

I have a doubt that i want to load images on canvas , i want to , which (method) one is best to do this .

12th Jun 2020, 8:46 AM
Priyanshu Gupta(प्रियांशु गुप्ता)
Priyanshu Gupta(प्रियांशु गुप्ता) - avatar
3 Antworten
+ 4
Use CanvasRenderingContext2D.prototype.putImageData() method. It has two standard syntax: 1) void ctx.putImageData(imageData, dx, dy); 2) void ctx.putImageData(imageData, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight); Read: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/putImageData
12th Jun 2020, 9:02 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
0
Var image=document.getElementById("image_id"); ctx.fillImage(image,x,y,dx,dy )
12th Jun 2020, 10:29 AM
Ayush kumar singh arya
Ayush kumar singh arya - avatar