教程
文章平均质量分 87
kw13202
这个作者很懒,什么都没留下…
展开
-
Canvas教程(4):运用样式与颜色
在 绘制图形 的章节里,我只用到默认的线条和填充样式。而在这一章里,我们将会探讨 canvas 全部的可选项,来绘制出更加吸引人的内容。色彩 ColorsUp until now we've only seen methods of the drawing context. If we want to apply colors to a shape, there are two important properties we can use: fillStyle and strokeStyl转载 2011-04-28 14:18:00 · 2279 阅读 · 0 评论 -
Canvas教程(3):应用图像 Using images
<br />One of the more fun features of the canvas is the abillity to use images. These can be used to do dynamic photo compositing or used as backdrops of graphs etc. It's currently also the only way to add text to them (The specification does not con转载 2011-04-28 14:13:00 · 573 阅读 · 0 评论 -
Canvas教程(1):Basic usage
<canvas>元素<br />Let's start this tutorial by looking at the <canvas> element itself. <br />让我们从<canvas>元素的定义开始吧。<canvas id="tutorial" width="150" height="150"></canvas><br /><br />This looks a lot like the <img> element, the only difference is that转载 2011-04-28 14:06:00 · 448 阅读 · 0 评论 -
Canvas教程(2):Drawing shapes 绘制图形
网格 The grid<br />Before we can start drawing, we need to talk about the canvas grid or coordinate space. The HTML template on the previous page had a canvas element 150 pixels wide and 150 pixels high. I've drawn this image with the default grid转载 2011-04-28 14:09:00 · 766 阅读 · 0 评论 -
Canvas教程(5):变形 Transformations
状态的保存和恢复 Saving and restoring state<br />Before we look at the transformation methods, I'll introduce two other methods which are indispensable once you start generating ever more complex drawings.<br />在了解变形之前,我先介绍一下两个你一旦开始绘制复杂图形就必不可少的方法。<br />save()<转载 2011-04-28 14:25:00 · 1515 阅读 · 0 评论 -
Canvas教程(6):组合 Compositing
<br />In all of our previous examples, shapes were always drawn one on top of the other. This is more than adequate for most situations. This, for instance, limits in what order composite shapes are built up. We can however change this behaviour by s转载 2011-04-28 15:09:00 · 475 阅读 · 0 评论