Jump to content

HTML5 Canvas to jpg/png


ibrahimjan

Recommended Posts

Hi AllAny one out there knows a bit about HTML5 <canvas>, I am trying to convert an SVG file to canvas using the google Canvg library, then if I am lucky convert the canvas to jpg or png file.At the moment, I managed to convert the SVG file to canvas, but the struggle is the jpg/png. Please feel free to have a look at the live link to get a better understanding of what I want to do.<script type="text/javascript" src="/js/rgbcolor.js"></script><script type="text/javascript" src="/js/canvg-1.0.js"></script><canvas id="canvas" width="0px" height="0px"></canvas><script type="text/javascript">window.onload = function() {var canvas = canvg('canvas', '../gallery/svg/myfile45.svg');window.location = canvas.toDataURL("image/png");}</script> Live script http://www.jancodesign.com/svg_canvas.asp

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...