HyperText Markup Language/Canvas
< HyperText Markup LanguageA Canvas allows for scriptable rendering of 2D shapes.A canvas can be rendered by JavaScript,which can be embedded into HTML. Rendering a Canvas:
<canvas id="e">This text will be displayed if the browser does not support canvas.</canvas>
JavaScript
var Canvas=document.getElementById("e");
var Context=Canvas.getContext("2d");
context.fillStyle="green";
context.fillRect(30,40,30,20);
context.strokeStyle="red";
context.strokeRect(30,40,30,20);
context.strokeText("Hello",30,40);
context.fillText("World",30,50);
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.