Draw Text in HTML : In this article i will show you how we can draw Text in HTML canvas. To draw Text in web page we will use Canvas API, we will draw the Text on canvas using the fillText() method. Following is the simple example to draw Text on canvas:
<!DOCTYPE html>
<html>
<body>
<canvas id="textCanvas" width="150" height="100" style="border:1px solid;"></canvas>
<script>
var c = document.getElementById("textCanvas");
var ctx = c.getContext("2d");
ctx.font = "35px Arial";
ctx.fillText("Hello This is TEXT",20,50);
</script>
</body>
</html>
0 Comment(s)