Overview of HTML5 Canvas

When you use a canvas element in your web page, it creates a rectangular area on the page. By default,
this rectangular area is 300 pixels wide and 150 pixels high, but you can specify the exact size and set
other attributes for your canvas element.  A Basic Canvas Element
<canvas></canvas>
Once you have added a canvas element to your page, you can use JavaScript to manipulate it any
way you want. You can add graphics, lines, and text to it; you can draw on it; and you can even add
advanced animations to it.
The Canvas API supports the same two-dimensional drawing operations that most modern
operating systems and frameworks support. If you have ever programmed two-dimensional graphics in
recent years, you will probably feel right at home with the Canvas API because it is designed to be similar
to existing systems. If you haven’t, you’re about to discover how much more powerful a rendering
system can be than the previous images and CSS tricks developers have used for years to create web
graphics.
To programmatically use a canvas, you have to first get its context. You can then perform actions on
the context and finally apply those actions to the context. You can think of making canvas modifications
as similar to database transactions: you start a transaction, perform certain actions, and then commit
the transaction.
Related Posts:
  • video element of HTML5. The video element is one of the more anticipated features of HTML5. With this tag, developers will be able to embed videos into a Web page without requiring a plugin like Flash. <video src = “bigBuck.ogv” controls> Yo… Read More
  • The html Element HTML5 Next up in any HTML document is the html element, which has not changed significantlywith HTML5. In our example, we’ve included the lang attribute with avalue of en, which specifies that the document is in English. In XHTML-… Read More
  • W3C node types Node type Numeric type value Description Element - Represents an element. Attribute - Represents an attribute. Text-3 Represents character data in an element or attribute. CDATA section - Represents text that may contain … Read More
  • A Basic HTML5 Template As you learn HTML5 and add new techniques to your toolbox, you’re likely goingto want to build yourself a blueprint, or boilerplate, from which you can begin allyour HTML5-based projects. In fact, you’ve probably already don… Read More
  • CSS and Canvas HTML5 As with most HTML elements, CSS can be applied to the canvas element itself to add borders, padding,margins, etc. Additionally, some CSS values are inherited by the contents of the canvas; fonts are a goodexample, as fonts d… Read More
  • The details Element HTML5 This new element helps mark up a section of the document that’s hidden, but canbe expanded to reveal additional information. The aim of the element is to providenative support for a feature common on the Web—a collapsible bo… Read More
  • How to Responsive web design Mobile Websites & Responsive Web Design from Go-MobileMobile Websites, Convert your existing website into a mobile device friendly format for your visitors & customers in just a few minutes.http://go-mobile.co… Read More
  • Overview of HTML5 Canvas When you use a canvas element in your web page, it creates a rectangular area on the page. By default,this rectangular area is 300 pixels wide and 150 pixels high, but you can specify the exact size and setother attributes f… Read More
  • The head Element HTML5 The next part of our page is the <head> section. The first line inside the head is theone that defines the character encoding for the document. This is another elementthat’s been simplified. Here’s how you used to do t… Read More
  • The context object drawing functionality HTML5 arc(): The arc command draws an arc (portion of a circle) as part of apath. The arc is defined like a circle, with a center and radius, but also withbeginning and ending angles. If the angles describe a full circle (0 to 2 ×… Read More
  • Sectioning HTML5 Elements header :-Header content (for a page or a section of the page) footer:- Footer content (for a page or a section of the page) section:- A section in a web page article:- Independent article content aside:- Related content or p… Read More
  • The svg element HTML5 The <svg> element allows the author to build a vector-based image directly in the page using the SVG markup language. <svg xmlns:xlink=”http://www.w3.org/1999/xlink” xmlns=”http://www.w3.org/2000/svg” viewBox=”0 0 … Read More
  • Using the Selectors API HTML5 getElementById() -Returns the element with the specified id attribute value<div id="foo">getElementById("foo"); getElementsByName() -Returns all elements whose nameattribute has the specified value<input type="text… Read More
  • The Doctype HTML5 First, we have the Document Type Declaration, or doctype. This is simply a way totell the browser—or any other parsers—what type of document they’re looking at.In the case of HTML files, it means the specific version and fla… Read More
  • Html Core Attributes Prior to HTML 4.0, few attributes could be used consistently for all the HTML tags. HTML 4.0 changed this, defining a set of 16 core attributes that you can apply to almost all the elements in both HTML 4.01 and XHTML 1.… Read More