欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

HTML5 canvas rotate() 方法

實例

將矩形旋轉(zhuǎn) 20 度:

Your browser does not support the HTML5 canvas tag.

JavaScript:

var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.rotate(20*Math.PI/180);
ctx.fillRect(50,20,100,50);

親自試一試

瀏覽器支持

Internet Explorer 9、Firefox、Opera、Chrome 以及 Safari 支持 rotate() 方法。

注釋:Internet Explorer 8 或更早的瀏覽器不支持 <canvas> 元素。

定義和用法

rotate() 方法旋轉(zhuǎn)當(dāng)前的繪圖。

JavaScript 語法:

context.rotate(angle);

參數(shù)值

參數(shù) 描述
angle

旋轉(zhuǎn)角度,以弧度計。

如需將角度轉(zhuǎn)換為弧度,請使用 degrees*Math.PI/180 公式進行計算。

舉例:如需旋轉(zhuǎn) 5 度,可規(guī)定下面的公式:5*Math.PI/180。