Answer the question
In order to leave comments, you need to log in
How to convert canvas to image, given styles applied to it?
There is a canvas element <canvas id="myCanvas"></canvas>
Then some styles applied to it
#myCanvas{
border:25px solid #FFF;
border-image-source:url(../images/frames/1.jpg);
border-image-slice:70;
border-image-repeat:round;
box-shadow:0 0 0 500px #FFF inset;
}
var canvas = document.getElementById('myCanvas');
var image = new Image();
image.src = canvas.toDataURL("image/png", 0.6);
window.open(image.src);
Answer the question
In order to leave comments, you need to log in
Canvas gives you a lot of power, and you use CSS for such a simple task ...
Draw this border directly on it, and then google the toDataURL method .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question