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

HTML5 canvas isPointInPath() 方法

實例

繪制一個矩形,如果點(diǎn) 20,50 位于當(dāng)前路徑中:

Your browser does not support the HTML5 canvas tag.

JavaScript:

var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.rect(20,20,150,100);
if (ctx.isPointInPath(20,50))
   {
   ctx.stroke();
   };

親自試一試

瀏覽器支持

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

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

定義和用法

isPointInPath() 方法返回 true,如果指定的點(diǎn)位于當(dāng)前路徑中;否則返回 false。

JavaScript 語法:

context.isPointInPath(x,y);

參數(shù)值

參數(shù) 描述
x 測試的 x 坐標(biāo)
y 測試的 y 坐標(biāo)