src/simg.js
function(cb){
      this.toCanvas(function(canvas){
        var canvasData = canvas.toDataURL("image/png");
        var img = document.createElement('img');

        img.onload = function(){
          cb(img);
        };

        // Make pngImg's source the canvas data.
        img.setAttribute('src', canvasData);
      });
    }
function(cb){
      this.toCanvas(function(canvas){
        var canvasData = canvas.toDataURL("image/png");
        var img = document.createElement('img');

        img.onload = function(){
          cb(img);
        };

        // Make pngImg's source the canvas data.
        img.setAttribute('src', canvasData);
      });
    }
function ( cb ) { this . toCanvas ( function ( canvas ) { var canvasData = canvas . toDataURL ( "image/png" ) ; var img = document . createElement ( 'img' ) ; img . onload = function ( ) { cb ( img ) ; } ; // Make pngImg's source the canvas data. img . setAttribute ( 'src' , canvasData ) ; } ) ; }
Returns callback to new img from SVG. Call with no arguments to return svg image element. Call with callback to return png image element.
Returns callback to new img from SVG . Call with no arguments to return svg image element . Call with callback to return png image element .