<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);
加载中,请稍侯......
精彩评论