Is there any way to scale the canvas using getImageData and putImageData.Below is the snippet of code.
var c=document.getElementById("myCanvas"); var c2=document.getElementById("myCanvas2"); var ctx=c.getContext("2d"); var ctx2=c2.getContext("2d"); ctx.fillStyle="red"; ctx.fillRect(10,10,50,50); function copy(){ var imgData=ctx.getImageData(10,10,50,50); ctx2.translate(133.333,0); ctx2.scale(0.75,1); ctx2.putImageData(imgData,10,70); }
I have tried this out http://jsbin.com/efixur/1/edit.
Thanks Ajain