开发者

<canvas> rect path - how?

I'm wondering how can I draw a path of a rect (like how 开发者_开发百科I can using lineTo()).


I don't understand what the problem here is. Doesn't the rect method do exactly that?


It's worth noting that the rect() function is different from the strokeRect() and fillRect() functions. These two functions draw on the canvas immediately without the need for beginPath() or stroke()/fill() calls. For example this draws a rectangle on to the canvas:

context.fillStyle = 'red'; context.fillRect(5,5,100,100);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜