标签:images rect context -- new src style span 绘制
Canvas提供了一个直接绘制矩形的方法:rect(x,y,width,height)
1 context.rect(50,50,100,100) 2 3 context.lineWidth = 10 4 context.strokeStyle = ‘#0091db‘ 5 context.fillStyle = ‘#00ff00‘ 6 7 context.stroke() 8 context.fill()
绘制矩形的其它方法:fillRect(x,y,width,height)、strokeRect(x,y,width,height)
1 context.lineWidth = 10 2 context.strokeStyle = ‘#0091db‘ 3 4 context.strokeRect(50,50,100,100)
1 context.lineWidth = 10 2 context.fillStyle = ‘#00ff00‘ 3 4 context.fillRect(50,50,100,100)
标签:images rect context -- new src style span 绘制
原文地址:http://www.cnblogs.com/yin-1841/p/7771563.html