new CRect(Obj, top, right, bottom)
common/Geometry.js, line 783
代表整數座標的一個範圍,如螢幕或影像等範圍,內部包含left,top,right,bottom 4個屬性
Name | Type | Description |
---|---|---|
Obj |
CRect | number | undefined |
為left,或本身就是一個CRect。 |
top |
number | undefined |
若Obj參數為top使用,否則此參數無意義。 |
right |
number | undefined |
若Obj參數為right使用,否則此參數無意義。 |
bottom |
number | undefined |
若Obj參數為bottom使用,否則此參數無意義。 |
Example
var a = new CRect({left:0,top:0,right:0,bottom:0});
var b = new CRect(0,0,0,0);
var c = new CRect();
Members
-
bottomdouble
-
下面
- Default Value:
- 0
-
readonlyHeight
-
高度
Properties:
Name Type Description Height
Number 高度
-
leftdouble
-
左邊
- Default Value:
- 0
-
rightdouble
-
右邊
- Default Value:
- 0
-
topdouble
-
上面
- Default Value:
- 0
-
readonlyWidth
-
寬度
Properties:
Name Type Description Width
Number 寬度
Methods
-
CopyFrom(Obj, top, right, bottom){CRect}
common/Geometry.js, line 855 -
複製。
Name Type Description Obj
CRect | number 為top,或本身就是一個CRect。
top
Number 若Obj參數為left使用,否則此參數無意義。
right
Number 若Obj參數為left使用,否則此參數無意義。
bottom
Number 若Obj參數為left使用,否則此參數無意義。
Returns:
Type Description CRect 傳回this。 -
IsEqual(Rect){Boolean}
common/Geometry.js, line 876 -
是否相等。
Name Type Description Rect
CRect 比較的Rect。
Returns:
Type Description Boolean 傳回比較的結果。 -
IsNotEqual(Rect){Boolean}
common/Geometry.js, line 885 -
是否不相等。
Name Type Description Rect
CRect 比較的Rect。
Returns:
Type Description Boolean 傳回比較的結果。 -
PtInRect(p){Boolean}
common/Geometry.js, line 904 -
檢查p是否位於Rect範圍內。
Name Type Description p
GeoPoint 檢查的值。
Returns:
Type Description Boolean 傳回檢查的結果。 -
SetNULL()
common/Geometry.js, line 892 -
將left,top,right,bottom都設為0