HTML5 canvas transform() 方法
实例
形;通过 transform() 调用 transform() 建:
JavaScript:
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.fillStyle="yellow";
ctx.fillRect(0,0,250,100)
ctx.transform(1,0.5,-0.5,1,30,10);
ctx.fillStyle="red";
ctx.fillRect(0,0,250,100);
ctx.transform(1,0.5,-0.5,1,30,10);
ctx.fillStyle="blue";
ctx.fillRect(0,0,250,100);
Internet Explorer 9、Firefox、Opera、Chrome 以及 Safari 支持 transform() 方法。
注释:Internet Explorer 8 <canvas> 元素。
。
transform() 阵:
a c e b d f 0 0 1
transform()
注释:影响 transform()
注释:transform() 相对于由 rotate(), scale(), translate(), or transform() 倍,则 transform() 四倍。
提示:请查看 setTransform() 生行为。
JavaScript 语法:
context.transform(a,b,c,d,e,f);
参数值
| 参数 | 描述 |
|---|---|
| a | 图 |
| b | 图 |
| c | 图 |
| d | 图 |
| e | 图 |
| f | 图 |