Raphaeljs用图像填充圆圈 [英] Raphaeljs fill the circle with an image

查看:167
本文介绍了Raphaeljs用图像填充圆圈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,那么我们有一个基本的情况,即绘制一个圆圈并用图像填充它。
这可以通过以下方式轻松完成:

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)'});

el.attr({'fill': 'url(image_url)'});

但是上面的缺点是没有缩放图像以适应圆圈。

but the above has a disadvantage of not scaling the image to fit in the circle.

所以基本上我正在寻找类似这样的东西(基于CSS):

So essentially I'm looking for something like this (CSS based):

http://jsfiddle.net/hKyzT/

任何提示?

任何帮助表示感谢!

问候

推荐答案

以下是Raphaël的修改版本:

Here's a modified version of Raphaël that does that:

http://xn--dahlstrm-t4a.net/svg/raphaeljs/fill-shape-with-image.html

这篇关于Raphaeljs用图像填充圆圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆