91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 103KB
    文件類型: .js
    金幣: 1
    下載: 1 次
    發(fā)布日期: 2021-05-13
  • 語言: Html/CSS
  • 標(biāo)簽: canvg??

資源簡介

首先需要獲取svg標(biāo)簽以及內(nèi)容: var svgHtml = svgContainer.innerHTML(); 將svg轉(zhuǎn)成canvas需要用到google的一個插件canvg 接下來就是調(diào)用該插件的canvg(canvasId,svgHtml)方法來轉(zhuǎn)成canvas,這個方法第一個參數(shù)就是canvas標(biāo)簽的id,第二個自然就是svg標(biāo)簽內(nèi)容了,就這樣,svg轉(zhuǎn)成了canvas 然后就是將canvas轉(zhuǎn)成圖片了,這個更加簡單了 var imgSrc = document.getElementById(canvasId).toDataUrl("image/png");//這其實是將canvas轉(zhuǎn)成了圖片, Use method as shown in the: http://blog.sina.com.cn/s/blog_025270e90101p6vs.html you need to first obtain SVG tag and content: var svgHtml = svgContainer. InnerHTML (); The SVG into canvas need to use the Google a canvg followed by calling the plugin canvg (canvasId svgHtml) method to convert to canvas, this method first parameter is the id tag, the second nature is SVG tag content, and thus, SVG is converted to the canvas and then the canvas into images, the more simple the var imgSrc = document. The getElementById (canvasId). ToDataUrl (& quot; image/png") ; / / this is the canvas into the image,.

資源截圖

代碼片段和文件信息

評論

共有 條評論

相關(guān)資源