Understanding the HTML5 Canvas Context

Part of the HTML5 Canvas For Dummies Cheat Sheet

An HTML-defined web page can have multiple Canvas areas. Each Canvas has an associated context. The ID defined in the <canvas> tag is used in JavaScript code to identify a Canvas and its associated context. Contexts are referenced using dot syntax notation. Here is an example: contextName.save().

getElementById("canvasName")
getContext("2d")
save()
restore()
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.