问题
How to draw circle filled by image and how to draw the sector of such circle? Is it possible to animate drawing sector (for example animate it's size by increasing angle)? What if I want to draw first sector from @image1@ and another sector from @image2@?
回答1:
To draw a circle filled by image you... simply draw the circle and fill it with an image :D
var c = paper.circle(200, 200, 40);
c.attr({fill:"url(http://path_to_the_image.png)"});
About drawing a sector I think that you actually have to draw a path and then fill it the same way like the circle. Using this technique you also solved the probelm of 2 sectors with different image fills :)
To animate the arc take a look at this example on raphalejs website
来源:https://stackoverflow.com/questions/7976838/raphael-drawing-circle-with-two-sectors-from-different-images