我正在尝试使用SVG教程,我只是像这样加载了一张图片:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg style="stroke-linejoin:round; stroke:black; stroke-width:0.5pt; text-anchor:middle; fill:none" xmlns="http://www.w3.org/2000/svg" font-family="Helvetica, Arial, FreeSans, Sans, sans, sans-serif" height="400px" width="400px" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 250 250">
<rect y="0" x="0" height="250" width="250" stroke="black" stroke-width="1" fill="blue" />
<image y="0" x="0" height="250" width="250" xlink:href="http://www.blueprintmodel.co.uk/images/DSCF1438.jpg" />
</svg>
即使宽度和高度相同,在viewBox中,我的图像仍然位于“rect”的中心位置。 我的问题是:
- 如何将图片拉伸到与矩形一样的大小?
- 为什么“image”标记中的“height”不能起作用?
- 是否有可以使用的“拉伸”或“调整大小”等变换? (我找不到它们)