HTML canvas arc() နည်းလမ်း
ဥပမာ
စက်ဝိုင်းတစ်ခု ဖန်တီးပါ-
JavaScript-
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.arc(100, 75, 50, 0, 2 * Math.PI);
ctx.stroke();
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် နည်းလမ်းကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Method | |||||
---|---|---|---|---|---|
arc() | Yes | 9.0 | Yes | Yes | Yes |
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
arc() method သည် arc/curve (စက်ဝိုင်းများဖန်တီးရန်အသုံးပြုသည်၊ သို့မဟုတ် စက်ဝိုင်း၏အစိတ်အပိုင်းများ) ကိုဖန်တီးသည်။
အကြံပြုချက်- arc() ဖြင့် စက်ဝိုင်းတစ်ခုကို ဖန်တီးရန်- စတင်ထောင့်ကို 0 နှင့် အဆုံးသတ်ထောင့်ကို 2*Math.PI သို့ သတ်မှတ်ပါ။
အကြံပြုချက်- ကင်းဗတ်စ်ပေါ်တွင် အနားကို အမှန်တကယ်ဆွဲရန် stroke () သို့မဟုတ် fill() နည်းလမ်းကို အသုံးပြုပါ။
စင်တာ
arc( 100,75 ,50,0*Math.PI,1.5*Math.PI)စတင်ထောင့်
arc(100,75,50, 0 ,1.5*Math.PI)ထောင့်စွန်း
arc(100,75,50,0*Math.PI, 1.5*Math.PI )
JavaScript syntax- | ဆက်စပ်မှု .arc( x,y,r,sAngle,eAngle,clockwise ); |
---|
ကန့်သတ်တန်ဖိုးများ
Parameter | Description | Play it |
---|---|---|
x | The x-coordinate of the center of the circle | |
y | The y-coordinate of the center of the circle | |
r | The radius of the circle | |
sAngle | The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) | |
eAngle | The ending angle, in radians | |
counterclockwise | Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. |
❮ HTML Canvas အကိုးအကား