Class Rectangle

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll
API Level:
3

The Rectangle class.

C#
Copy
public class Rectangle : Disposable, ICloneable
Inheritance
Rectangle
Implements
ICloneable

Constructors

View Source

Rectangle()

The constructor.

Declaration
C#
Copy
public Rectangle()
API Level: 3
View Source

Rectangle(Int32, Int32, Int32, Int32)

The constructor.

Declaration
C#
Copy
public Rectangle(int x, int y, int width, int height)
Parameters
Type Name Description
Int32 x

The x coordinate (or left).

Int32 y

The y coordinate (or right).

Int32 width

The width (or bottom).

Int32 height

The height (or top).

API Level: 3

Properties

View Source

Height

The height of the rectangle.

Declaration
C#
Copy
public int Height { get; set; }
Property Value
Type Description
Int32
Remarks

The setter is deprecated in API8 and will be removed in API10. Use new Rectangle(...) constructor.

API Level: 3
View Source

Width

The width of the rectangle.

Declaration
C#
Copy
public int Width { get; set; }
Property Value
Type Description
Int32
Remarks

The setter is deprecated in API8 and will be removed in API10. Use new Rectangle(...) constructor.

API Level: 3
View Source

X

The x position of the rectangle.

Declaration
C#
Copy
public int X { get; set; }
Property Value
Type Description
Int32
Remarks

The setter is deprecated in API8 and will be removed in API10. Use new Rectangle(...) constructor.

API Level: 3
View Source

Y

The Y position of the rectangle.

Declaration
C#
Copy
public int Y { get; set; }
Property Value
Type Description
Int32
Remarks

The setter is deprecated in API8 and will be removed in API10. Use new Rectangle(...) constructor.

API Level: 3

Methods

View Source

Area()

Gets the area of the rectangle.

Declaration
C#
Copy
public int Area()
Returns
Type Description
Int32

The area of the rectangle.

API Level: 3
View Source

Bottom()

Gets the bottom of the rectangle.

Declaration
C#
Copy
public int Bottom()
Returns
Type Description
Int32

The bottom of the rectangle.

API Level: 3
View Source

Clone()

Declaration
C#
Copy
public object Clone()
Returns
Type Description
Object
View Source

Contains(Rectangle)

Determines whether or not this rectangle contains the specified rectangle.

Declaration
C#
Copy
public bool Contains(Rectangle other)
Parameters
Type Name Description
Rectangle other

The other rectangle to test against this rectangle.

Returns
Type Description
Boolean

True if the specified rectangle is contained.

API Level: 3
View Source

Equals(Object)

Equality operator.

Declaration
C#
Copy
public override bool Equals(object o)
Parameters
Type Name Description
Object o

The object to compare with the current object.

Returns
Type Description
Boolean

True if boxes are exactly same.

API Level: 4
View Source

GetHashCode()

Serves as the default hash function.

Declaration
C#
Copy
public override int GetHashCode()
Returns
Type Description
Int32

A hash code for the current object.

API Level: 4
View Source

Intersects(Rectangle)

Determines whether or not this rectangle and the specified rectangle intersect.

Declaration
C#
Copy
public bool Intersects(Rectangle other)
Parameters
Type Name Description
Rectangle other

The other rectangle to test against this rectangle.

Returns
Type Description
Boolean

True if the rectangles intersect.

API Level: 3
View Source

IsEmpty()

Determines whether or not this rectangle is empty.

Declaration
C#
Copy
public bool IsEmpty()
Returns
Type Description
Boolean

True if width or height are zero.

API Level: 3
View Source

Left()

Gets the left of the rectangle.

Declaration
C#
Copy
public int Left()
Returns
Type Description
Int32

The left edge of the rectangle.

API Level: 3
View Source

ReleaseSwigCPtr(Runtime.InteropServices.HandleRef)

Declaration
C#
Copy
protected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type Name Description
Tizen.System.Runtime.InteropServices.HandleRef swigCPtr
Overrides
View Source

Right()

Gets the right of the rectangle.

Declaration
C#
Copy
public int Right()
Returns
Type Description
Int32

The right edge of the rectangle.

API Level: 3
View Source

Set(Int32, Int32, Int32, Int32)

Assignment from individual values.

Declaration
C#
Copy
public void Set(int newX, int newY, int newWidth, int newHeight)
Parameters
Type Name Description
Int32 newX

The x coordinate.

Int32 newY

The y coordinate.

Int32 newWidth

The width.

Int32 newHeight

The height.

API Level: 3
View Source

Top()

Gets the top of the rectangle.

Declaration
C#
Copy
public int Top()
Returns
Type Description
Int32

The top of the rectangle.

API Level: 3

Operators

View Source

Equality(Rectangle, Rectangle)

THe Equality operator.

Declaration
C#
Copy
public static bool operator ==(Rectangle a, Rectangle b)
Parameters
Type Name Description
Rectangle a

The first operand.

Rectangle b

The second operand.

Returns
Type Description
Boolean

True if the boxes are exactly the same.

API Level: 3
View Source

Implicit(Int32 to Rectangle)

The type cast operator, int to Rectangle.

Declaration
C#
Copy
public static implicit operator Rectangle(int value)
Parameters
Type Name Description
Int32 value

A value of int type.

Returns
Type Description
Rectangle

return a Extents instance

View Source

Inequality(Rectangle, Rectangle)

Inequality operator.

Declaration
C#
Copy
public static bool operator !=(Rectangle a, Rectangle b)
Parameters
Type Name Description
Rectangle a

The first rectangle.

Rectangle b

The second rectangle.

Returns
Type Description
Boolean

True if the rectangles are not identical.

API Level: 3

Implements

ICloneable

Extension Methods