HTML canvas strokeRect() နည်းလမ်း
ဥပမာ
150*100 pixels စတုဂံတစ်ခုဆွဲပါ-
JavaScript-
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.strokeRect(20, 20, 150, 100);
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် နည်းလမ်းကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Method | |||||
---|---|---|---|---|---|
strokeRect() | Yes | 9.0 | Yes | Yes | Yes |
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
strokeRect() method သည် ထောင့်မှန်စတုဂံတစ်ခုဆွဲသည် (ဖြည့်စွက်ခြင်းမရှိပါ)။ လေဖြတ်ခြင်း၏ မူရင်းအရောင်မှာ အနက်ရောင်ဖြစ်သည်။
အကြံပြုချက်- လေဖြတ်ခြင်းကို ပုံစံချရန် အရောင်၊ အရောင်အသွေး၊ သို့မဟုတ် ပုံစံတစ်ခုကို သတ်မှတ်ရန် strokeStyle ပိုင်ဆိုင်မှုကို အသုံးပြု ပါ။
JavaScript syntax- | စကား စပ် .strokeRect( x၊y၊width၊height ) ; |
---|
ကန့်သတ်တန်ဖိုးများ
Parameter | Description | Play it |
---|---|---|
x | The x-coordinate of the upper-left corner of the rectangle | |
y | The y-coordinate of the upper-left corner of the rectangle | |
width | The width of the rectangle, in pixels | |
height | The height of the rectangle, in pixels |
❮ HTML Canvas အကိုးအကား