HTML canvas isPointInPath() နည်းလမ်း
ဥပမာ
အမှတ် 20,50 သည် လက်ရှိလမ်းကြောင်းတွင်ရှိနေပါက ထောင့်မှန်စတုဂံတစ်ခုဆွဲပါ။
JavaScript-
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.rect(20, 20, 150, 100);
if (ctx.isPointInPath(20, 50)) {
ctx.stroke();
};
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် နည်းလမ်းကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Method | |||||
---|---|---|---|---|---|
isPointInPath() | Yes | 9.0 | Yes | Yes | Yes |
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
သတ်မှတ်ထားသောအမှတ်သည် လက်ရှိလမ်းကြောင်းတွင်ရှိနေပါက isPointInPath() method သည် အမှန်အတိုင်းပြန်လာသည်၊ သို့မဟုတ်ပါက မှားသည်။
JavaScript syntax- | ဆက်စပ်အကြောင်းအရာ .isPointInPath( x,y ); |
---|
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
x | The x-coordinate to test |
y | The y-coordinate to test |
❮ HTML Canvas အကိုးအကား