html5的canvas教程
If fallback content is not needed, a simple <canvas id="foo" ...></canvas> will be fully compatible with both Safari and Mozilla -- Safari will simply ignore the end tag.
如果没有替用内容,<canvas id="foo" ...></canvas> 对 Safari 和 Mozilla 是完全兼容的—— Safari 会简单地忽略结束标签。
If fallback content is desired, some CSS tricks must be employed to mask the fallback content from Safari (which should render just the canvas), and also to mask the CSS tricks themselves from IE (which should render the fallback content).
如果有替用内容,那么可以用一些 CSS 技巧来为并且仅为 Safari 隐藏替用内容,因为那些替用内容是需要在 IE 里显示但不需要在 Safari 里显示。
渲染上下文(Rendering Context)
<canvas> creates a fixed size drawing surface that exposes one or more rendering contexts, which are used to create and manipulate the content shown. We'll focus on the 2D rendering context, which is the only currently defined rendering context. In the future, other contexts may provide different types of rendering; for example, it is likely that a 3D context based on OpenGL ES will be added.
<canvas> 创建的固定尺寸的绘图画面开放了一个或多个渲染上下文(rendering context),我们可以通过它们来控制要显示的内容。我们专注于2D 渲染上,这也是目前唯一的选择,可能在将来会添加基于OpenGL ES 的 3D 上下文。
The <canvas> is initially blank, and to display something a script first needs to access the rendering context and draw on it. The canvas element has a DOM method called getContext, used to obtain the rendering context and its drawing functions. getContext() takes one parameter, the type of context.
<canvas> 初始化是空白的,要在上面用脚本画图首先需要其渲染上下文(rendering context),它可以通过 canvas 元素对象的 getContext 方法来获取,同时得到的还有一些画图用的函数。getContext() 接受一个用于描述其类型的值作为参数。
var canvas = document.getElementById('tutorial'); var ctx = canvas.getContext('2d');
In the first line we retrieve the canvas DOM node using the getElementById method. We can then access the drawing context using the getContext method.
html5基础教程_canvas标签介绍_计算机软件及应用_IT/计算机_专业资料。html视频教程,专注html教程,提供专业的html视频教程下载。html基础教程-零基础学习html-html...
[HTML5资料]Canvas教程_日语学习_外语学习_教育专区 暂无评价0人阅读0次下载举报文档 [HTML5资料]Canvas教程_日语学习_外语学习_教育专区。HTML 学习资料...
HTML5 canvas基础教程_互联网_IT/计算机_专业资料。这是我自己在学习canvas时总结的一份基础教程测试IE 下能否正常使用 canvas 说明 低版本的 IE 不能有效的...
html5基础教程_canvas实例2-太阳系2 课件_其它语言学习_外语学习_教育专区。... HTML5 canvas基础教程 66页 1下载券 [HTML5资料]Canvas教程 49页 4下载券 ...
HTML5.Canvas.教程_计算机软件及应用_IT/计算机_专业资料。方便各位学习新技术,web前端开发HTML5 Canvas 教程原作者:Eric Rowell 原文地址:http://www.html5...
HTML5 Canvas 2D API 规... 30页 免费 [HTML5资料]Canvas教程 80页 免费...HTML5 canvas 初级入门教程 HTML5 canvas 即 HTML5 画布,是一个现代浏览器都...
HTML5 Canvas 属性、定义及方法_IT/计算机_专业资料。HTML5 Canvas 属性、... roid-HTML5-Canvas教程 397页 2下载券 html5 canvas基础实例 7页 免费...
HTML5教程_IT/计算机_专业资料。HTML5教程特别说明此资料来自豆丁网(http://... HTML5 Canvas教程 84页 1下载券 HTML5基础教程之HTML5基... 2页 免费...
HTML5 canvas全解析_互联网_IT/计算机_专业资料。HTML5 canvas全解析... [HTML5资料]Canvas教程 80页 免费 HTML5应用介绍 35页 免费 adobe edge ...
23页 免费 html5 canvas基础实例 7页 免费 html5 canvas 基础 10页 2财富值 [HTML5资料]Canvas教程 80页 免费 HTML5-Canvas简介 11页 1财富值...
热门文档