S
S
SEOD2019-12-25 07:23:27
JavaScript
SEOD, 2019-12-25 07:23:27

How to render SVG in Canvas?

I found a method for transferring a rendered SVG image to Canvas:
https://jsfiddle.net/Wijmo5/h2L3gw88/
But this code could not run in any browsers. Canvas is empty. Maybe someone knows what's wrong or someone has a working example lying around?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-12-25
@SEOVirus

img.onload = () => canvas.getContext('2d').drawImage(img, 0, 0);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question