HTML5 Canvas Line Tutorial

To draw a line using HTML5 Canvas, we can use the beginPath()moveTo()lineTo(), and stroke() methods.

First, we can use the beginPath() method to declare that we are about to draw a new path.  Next, we can use the moveTo() method to position the context point (i.e. drawing cursor), and then use the lineTo() method to draw a straight line from the starting position to a new position.  Finally, to make the line visible, we can apply a stroke to the line using stroke().  Unless otherwise specified, the stroke color is defaulted to black.


邮箱:
密码:

微信扫描二维码捐赠

当前实例由www.100sucai.com整理,
仅作学习参考。感谢大家对本站的支持
web前端交流群:Css Js 网站美工
Line Width