I want to fill a svg element e.g. a circle
element with an image that the user can select from his local computer via a <input type='file'/>
input.
I know that you can fill a svg element using a pattern:
<defs>
<pattern id="img1" patternUnits="userSpaceOnUse" width="100" height="100">
<image xlink:href="wall.jpg" x="0" y="0" width="100" height="100" />
</pattern>
</defs>
<circle cx=100 cy=100 r=100 fill="url(#img1)" />
But I can't get it to work with a local Image.
A working fiddle would be amazing :)
Related Issues:
Fill SVG path element with a background-image
Thanks!