Syntax for SVG <image> element using a local resource

喜欢而已 提交于 2019-12-31 00:58:05

问题


Is there a difference in the syntax when using the SVG-image-element with a local source (e.g. C:\image.png) and a source on the internet (e.g http://www.google.de/intl/de_ALL/images/logos/images_logo_lg.gif)?

My Problem is that the following works:

<image x="100" y="100" width="100" height="100" xlink:href="http://www.google.de/intl/de_ALL/images/logos/images_logo_lg.gif">
</image>

and with the following, i'm just getting a white page:

<image x="100" y="100" width="100" height="100" href="C:\google.png"></image>

回答1:


Have you tried "file:///c:/google.png"?




回答2:


Solved the problem...:

<image x="100" y="100" width="100" height="100" xlink:href="file://C:\google.png"></image>

Thank you!




回答3:


The path you should use for macOS is:

file:///Users/aizat/.../image.png




回答4:


I think you should try use the file:// protocol

Take the remote page and do a save page as on chrome and see what manipulation he do to the image tag.



来源:https://stackoverflow.com/questions/12456007/syntax-for-svg-image-element-using-a-local-resource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!