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 Answers
+ 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