Wednesday, 15 October 2014

HTML5 Canvas Simple Page Code With Demo

Hi,

Below source code helps you to create a text graphics with the help of HTML5 Canvas element tag.

See it in action



<!DOCTYPE html>
<html>
<body>

<canvas id="canvasId" width="595" height="105" style="border:1px solid;">
Sorry, Your browser does not support the HTML5 Canvas tag.</canvas>

<script>

var can = document.getElementById("canvasId");
var cont= can.getContext("2d");
cont.font = "55px Arial";
cont.fillStyle = "blue";
cont.fillText("Welcome To Jenson.in",20,75);

</script>

</body>
</html>

No comments:

Post a Comment

blogger visitor