API de Canvas
Mozilla applications gained support for
<canvas> starting with Gecko 1.8 (i.e. Firefox 1.5). The element was originally introduced by Apple for the OS X Dashboard and Safari. Internet Explorer supports
<canvas> from version 9 onwards; for earlier versions of IE, a page can effectively add support for
<canvas> by including a script from Google's Explorer Canvas project. Google Chrome and Opera 9 also support
<canvas> element is also used by WebGL to draw hardware-accelerated 3D graphics on web pages.
This is just a simple code snippet which uses the
CanvasRenderingContext2D.fillRect() (en-US) method.
var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); ctx.fillStyle = 'green'; ctx.fillRect(10, 10, 100, 100);
Edit the code below and see your changes update live in the canvas:
The interfaces related to the
WebGLRenderingContext are referenced under WebGL.
CanvasCaptureMediaStream (en-US) is related.
- Canvas tutorial
- A comprehensive tutorial covering both the basic usage of
<canvas>and its advanced features.
- Code snippets: Canvas
- Some extension developer-oriented code snippets involving
- Demo: A basic ray-caster
- A demo of ray-tracing animation using canvas.
- Drawing DOM objects into a canvas
- How to draw DOM content, such as HTML elements, into a canvas.
- Manipulating video using canvas
<video>and <canvas> (en-US) to manipulate video data in real time.
- Fabric.js is an open-source canvas library with SVG parsing capabilities.
- Kinetic.js is an open-source canvas library focused on interactivity for desktop and mobile applications.
- Paper.js is an open source vector graphics scripting framework that runs on top of the HTML5 Canvas.
- Origami.js is an open source lightweight canvas library.
- libCanvas is powerful and lightweight canvas framework.
- Processing.js is a port of the Processing visualization language.
- PlayCanvas is an open source game engine.
- Pixi.js is an open source game engine.
- PlotKit is a charting and graphing library.
- Rekapi is an animation key-framing API for Canvas.
- PhiloGL is a WebGL framework for data visualization, creative coding and game development.
- EaselJS is a free/open source library to make it easier to use canvas for games and art
- heatmap.js is an open source library to create canvas based heatmaps
|HTML Living Standard
The definition of '<canvas>' in that specification.
- WebGL (Biblioteca de Gráficos da Web)