问题
Okay then we have a basic situation, that is drawing a circle and filling it with an image. This can be easily done by using:
el.attr({'fill': 'url(image_url)'});
but the above has a disadvantage of not scaling the image to fit in the circle.
So essentially I'm looking for something like this (CSS based):
http://jsfiddle.net/hKyzT/
any hints?
Any help appreciated!
Regards
回答1:
Here's a modified version of Raphaël that does that:
http://xn--dahlstrm-t4a.net/svg/raphaeljs/fill-shape-with-image.html
来源:https://stackoverflow.com/questions/12274137/raphaeljs-fill-the-circle-with-an-image