|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
|
5 </head> |
|
6 <body> |
|
7 <p><canvas width="500" height="200" id="c"></canvas></p> |
|
8 <script type="text/javascript"> |
|
9 |
|
10 var canvas = document.getElementById('c'); |
|
11 var ctx = canvas.getContext('2d'); |
|
12 |
|
13 ctx.beginPath(); |
|
14 |
|
15 ctx.lineWidth = 20; |
|
16 ctx.strokeStyle = 'rgb(0,0,0)'; |
|
17 |
|
18 ctx.moveTo(10, 30); |
|
19 ctx.lineTo(50, 50); |
|
20 |
|
21 ctx.stroke(); |
|
22 |
|
23 ctx.lineTo(80, 80); |
|
24 ctx.stroke(); |
|
25 |
|
26 </script> |
|
27 </body> |
|
28 </html> |