652aad4bly1g4gjxj3pr8j20u0140npe.jpg

Hi.

Welcome to my blog. This is Shinainai . I am a programmer . I live in California.I love art! I love STEM! Hope you have a nice stay!

HTML5 Canvas Tutorial4 - Lines

HTML5 Canvas Tutorial4 - Lines

Methods

beginPath():begins a path

moveTo(x,y):moves the pen to the coordinates specified by x and y

lineTo(x,y):draws a line from the current drawing position to the position specified by x and y

stroke():draws the path on the canvas

Demo

drawline.png

Try this code

drawline2.png
HTML5 Canvas Tutorial5 - Arcs

HTML5 Canvas Tutorial5 - Arcs

HTML5 Canvas Tutorial3 - Coordinates

HTML5 Canvas Tutorial3 - Coordinates