Javascript的 SVG 解析器和渲染器:canvg
canvg 是个 SVG 解析器和渲染器,把 URL 转换成 SVG 文件,或者是 SVG 文本文件。它使用 Javascript 解析,渲染出 Canvas 元素,渲染速度跟本地 SVG 一样。
  
<script type="text/javascript">  window.onload = function() {    //load '../path/to/your.svg' in the canvas with id = 'canvas'    canvg('canvas', '../path/to/your.svg')      //load a svg snippet in the canvas with id = 'drawingArea'    canvg(document.getElementById('drawingArea'), '<svg>...</svg>')      //ignore mouse events and animation    canvg('canvas', 'file.svg', { ignoreMouse: true, ignoreAnimation: true })   }  </script> 本文由用户 jopen  自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
                 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
                 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!