0
我已經添加了一個SVG到畫布元素。如何獲得閱讀SVG的viewbox屬性的權限?如何在canvas元素中讀取SVG的viewbox屬性?
var canvas = document.getElementById('myCanvas');
var ctx = canvas.getContext('2d');
var img = new Image();
img.id = "svgObjectElement";
img.type = "image/svg+xml";
img.onload = function(){
ctx.drawImage(img,0,0);
};
img.src = "mySvg.svg";
謝謝,我曾希望在畫布上添加'