How to Include CSS style when converting svg to png

后端 未结 1 550
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 15:30

i\'ve created a simple SVG elment that get dowbloaded to png when clicking on a button, my solution is similiar to here


The basic idea is:
1.svg to canvas<

1条回答
  •  粉色の甜心
    2020-11-30 16:09

    Question 1 (first half): what's the real reason (is the GPU acceleration related in anyway?)

    No, GPU acceleration has nothing to do with it.
    The broadest reason is privacy.

    To draw your svg with drawImage you have to load your svg as an external document inside an tag. SVG can be quite a complex image format for resources loading (it can literally require any kind of resource that could be required by any HTML document). Thus, it has been stated in specs that the same security as the one for