html5 - Display canvas image from one canvas to another canvas using base64 -


e.g. var new = canvas.todataurl("image/png");

i want base64 present in new variable displayed 2nd canvas element present. not display base64 image using drawimage method. works if use image.png

you shouldn't use base64 copy canvas. can pass source canvas destination canvas' context method, drawimage.

otherwise suffer serious performance hit. see jsperf test @ http://jsperf.com/copying-a-canvas-element.

drawimage() accept canvas image object.

try this:

//grab context destination canvas var destctx = destinationcanvas.getcontext('2d');  //call drawimage() function passing source canvas directly destctx.drawimage(sourcecanvas, 0, 0); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -