<!DOCTYPE HTML>
<html>
<body>
<canvas id="myCanvas" width="500" height="500" style="border:3px solid #00FF00;"></canvas>
<!--Setting of size of Canvas-->
<script>
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
context.strokeStyle = "#FF00FF";
<!--Setting of color of lines-->
context.lineCap = 'round';
context.lineWidth = 20;
context.beginPath();<!--To start a line beginpath is required-->
context.moveTo(100, 100);<!--Starting point of line in canvas-->
context.lineTo(400, 400);<!--End point of line in canvas-->
context.stroke();<!--for the drawing of line stroke is required-->
</script>
</body>
</html>
No comments:
Post a Comment
Note: only a member of this blog may post a comment.