Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head></head>
- <body>
- <canvas id="canvas_object" width="600" height="500"></canvas>
- <script>
- var canvas = document.getElementById('canvas_object');
- var context = canvas.getContext('2d');
- context.beginPath();
- //context.moveTo((canvas.width/2),100);
- //context.lineTo(20,300);
- context.lineWidth = 20;
- //set line color
- context.strokeStyle = '#00FF00';
- context.lineCap = 'round';
- //Line and arc
- //arc
- var x = 130;
- var y = 200;
- var radius = 60;
- var startAngle = 1.0 * Math.PI;
- var endAngle = 1.5 * Math.PI;
- var ccw = false;
- //context.beginPath();
- context.arc(x,y,radius,startAngle,endAngle,ccw);
- context.moveTo(70,y);
- context.lineTo(70,canvas.height);
- context.stroke();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement