【发布时间】:2013-03-08 02:22:24
【问题描述】:
我想在canvas 中绘制这种螺旋图案我正在使用下面的代码
需要您的帮助以进一步绘制圆圈。
// get the canvas element using the DOM
var canvas = document.getElementById('circlecanvas');
// Make sure we don't execute when canvas isn't supported
if (canvas.getContext){
// use getContext to use the canvas for drawing
var ctx = canvas.getContext('2d');
// Draw shapes
ctx.beginPath();
//context.arc(x, y, radius, startAngle, endAngle, counterClockwise);
for (i=0;i<9;i++){
ctx.arc(50, 50, 50, i, Math.PI * 2, false);
ctx.fill();
}
}
【问题讨论】:
-
您遇到的问题是什么?什么都没发生?有错误吗?等等?
-
只有一个圆圈在画.. 但想要看起来像图案
标签: html html5-canvas