Syntax for SVG element using a local resou

2019-02-25 07:46发布

问题:

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:

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.