javascript - canvas.toDataURL results in solid black image? -
i have canvas element doodling in it.
i using following convert canvas jpeg:
var data = canvas.todataurl( "image/jpeg", 0.5 ); var img = new image(); img.src = data; $( "body" ).append( img );
however instead of doodle, solid black jpeg.
can tell me i'm doing wrong?
thanks!
thats happening because jpeg not support transparent background.. if want supported use png (the default extension) else can set non transparent fill color canvas using .fillstyle
, .fillrect
Comments
Post a Comment