我有一个适合其父<object>尺寸的SVG图像。通过更改图像的currentScale和currentTranslate属性来缩放图像。如何缩放要显示的图像的预期大小并使其在视口中居中?
示例代码:
<object width="500" height="300" data="pic.svg">
<!-- The image will scale to be 300px heigh,
I need it to be shown at 32x32 and centered in the v
我将SVG嵌入到下面的代码中:
<div id="svgInlineDiv" style='background-color:white'></div>
<script>
document.addEventListener("onload",inlineSVG(),false);
function inlineSVG()
{
var SVGFile="img/office_lights.svg";
var loadXML = new XM