Prev Demo
Line Width
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Linewidth</title> </head> <body> <canvas id="myCanvas" width="578" height="200"></canvas> <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); context.beginPath(); context.moveTo(10, 40); context.lineTo(250, 50); context.lineWidth = "10"; context.strokeStyle = "blue"; context.stroke(); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output