Raphaeljs fill the circle with an image

女生的网名这么多〃 提交于 2019-12-08 03:54:56

问题


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

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