html and Svg to Canvas javascript

前端 未结 5 668
别那么骄傲
别那么骄傲 2021-02-02 01:36
&l
5条回答
  •  春和景丽
    2021-02-02 02:01

    You can create your own innerHTML, like the following setSVG: enter image description here

    In fact, you only need to pay attention to two steps: creating the SVG context label and setting properties (with context)

    createElementNS and setAttributeNS are two methods you may need!

    Common namespaces are as follows:

    • svg:http://www.w3.org/2000/svg

    • xhtml:http://www.w3.org/1999/xhtml

    • xlink:http://www.w3.org/1999/xlink

    • xml:http://www.w3.org/XML/1998/namespace

    • xmlns:http://www.w3.org/2000/xmlns/

提交回复
热议问题