admin管理员组文章数量:1356851
I'm trying to write a program where users upload circular images like this deliciously warm pizza:
The user then specifies the start and end of the arc in degrees so that a function will be called to display the same image, with a lower opacity on the leftover portion.
function cutPizza (startArcDegree, endArcDegree){
//This is where I need help
}
cutPizza(150, 225);
Are there any css or javascript techniques to help me achieve this (Or any or ways for that matter)?
I'm trying to write a program where users upload circular images like this deliciously warm pizza:
The user then specifies the start and end of the arc in degrees so that a function will be called to display the same image, with a lower opacity on the leftover portion.
function cutPizza (startArcDegree, endArcDegree){
//This is where I need help
}
cutPizza(150, 225);
Are there any css or javascript techniques to help me achieve this (Or any or ways for that matter)?
Share Improve this question asked Feb 29, 2012 at 7:37 user784637user784637 16.2k33 gold badges96 silver badges159 bronze badges 3- 5 +1 for 'deliciously warm pizza' – Sean Carruthers Commented Feb 29, 2012 at 7:39
- Can you show us what you have got so far? – Starx Commented Feb 29, 2012 at 7:40
- 1 I usually use Raphael for this sort of thing. Here's a vaguely related demo. – thirtydot Commented Feb 29, 2012 at 10:51
2 Answers
Reset to default 6Yes, you should have a canvas that has a relative position to your pizza image. Then you can draw your circle on canvas, and configure canvas transparency
Read how to draw circles from here:
http://billmill/static/canvastutorial/ball.html
You could try generating a SVG and then look into Clipping, Masking and Compositing
本文标签: Any css or javascript techniques to display a 39slice39 of a circle imageStack Overflow
版权声明:本文标题:Any css or javascript techniques to display a 'slice' of a circle image? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743963934a2569541.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论