HTML canvas rotate() နည်းလမ်း
ဥပမာ
ထောင့်မှန်စတုဂံကို 20 ဒီဂရီလှည့်ပါ။
JavaScript-
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.rotate(20 * Math.PI / 180);
ctx.fillRect(50, 20, 100, 50);
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် နည်းလမ်းကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Method | |||||
---|---|---|---|---|---|
rotate() | Yes | 9.0 | Yes | Yes | Yes |
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
rotate() method သည် လက်ရှိ ပုံအား လှည့်သည်။
မှတ်ချက် ။
JavaScript syntax- | context .rotate( ထောင့် ); |
---|
ကန့်သတ်တန်ဖိုးများ
Parameter | Description | Play it |
---|---|---|
angle | The rotation angle, in radians. To calculate from degrees to radians: degrees*Math.PI/180. Example: to rotate 5 degrees, specify the following: 5*Math.PI/180 |
❮ HTML Canvas အကိုးအကား