Draw Canvas using HTML5

Leave a Comment
HTML5 is providing to draw canvas on web page. Here i am going to explain complete code with output demo. Canvas is providing to draw in webpage. in html 5 canvas tag is available for all these facilities.

<!DOCTYPE html>
<html>
<body>
<canvas id="devang canvas" width="200" height="200" style="border:1px solid #c3c3c3;">
</canvas>
</body>
</html>
output:


2]] how to make drawing on canvas:

<!DOCTYPE html>
<html>
<body>
<canvas id="devangcanvas" width="200" height="200" style="border:1px solid #c3c3c3;">
</canvas>
<script>
var c=document.getElementById("devangcanvas");
var ctx=c.getContext("2d");
ctx.fillStyle="#c3c3c3";
ctx.fillRect(0,0,200,200);
</script>
</body>
</html>

I hope now you can understand actual use of canvas.

0 comments:

Post a Comment