HTML Canvas 2

HTML Canvas 2

Code for Canvas 2

<!DOCTYPE html>
<html>
<head>

</head>
<body>

<p>Canvas</p>
<canvas id="myCanvas" height=300 width=500 style="border:2px solid;">
</canvas>

<script>
var canvas = document.getElementById("myCanvas");
var ctx = canvas.getContext("2d");
ctx.moveTo(0,100);
ctx.lineTo(500,100);
ctx.moveTo(0,200);
ctx.lineTo(500,200);
ctx.stroke();

</script>
</body>
</html>

Comments

Popular posts from this blog

C++ Practice Program

Cloud Computing Important Question-Answer for University Exam

Software Testing Gujarat University Important Questions For Exam