Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在SVG中不缩放图像_Svg - Fatal编程技术网

如何在SVG中不缩放图像

如何在SVG中不缩放图像,svg,Svg,因此,我在SVG中有一个图像,如下所示: <image id="svgBackground" x="0px" y="0px" width="100%" height="100%" preserveAspectRatio="xMinYMin" xlink:href="backgrounds.png"/> 我希望浏览器以原始大小显示图像。如何操作?使用“px”单位指定图像的原始大小:width=“150px”height=“100px”或任何应该的单位 如果您完全省略width和/

因此,我在SVG中有一个图像,如下所示:

<image id="svgBackground" x="0px" y="0px" width="100%" height="100%" preserveAspectRatio="xMinYMin" xlink:href="backgrounds.png"/>


我希望浏览器以原始大小显示图像。如何操作?

使用“px”单位指定图像的原始大小:
width=“150px”height=“100px”
或任何应该的单位


如果您完全省略
width
和/或
height
,它将默认为零,并且不会渲染图像。

当然只需删除
width=“100%”和
height=“100%”
并让浏览器处理它?我已经尝试过了,但如果我这样做,图像根本不会显示出来。您能在,还是类似的网站?
preserveSpectratio=“none”