How do I render a canvas as an image with multiple image drawn on it and the image which I used to draw is cross origin.
While doing toDataURL()
the image which I draw isn't coming.
Thanks in advance
this is my code
var canvas = document.getElementById("myCanvas");
var ctx = canvas.getContext("2d");
baseimage = new Image();
baseimage.src = '' + data.picture.data.url + '';
baseimage.onload = function() {
ctx.drawImage(baseimage, 1, 1);
}
var dataURL = canvas.toDataURL("image/png");