Class Rectangle

Definition

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

The Rectangle class.

C#
Copy
public class Rectangle : Disposable, IDisposable, ICloneable
Inheritance
System.Object
Rectangle
Implements
System.IDisposable
System.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; [Obsolete("Do not use this setter, that is deprecated in API8 and will be removed in API10. Use new Rectangle(...) constructor")] 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; [Obsolete("Do not use this setter, that is deprecated in API8 and will be removed in API10. Use new Rectangle(...) constructor")] 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; [Obsolete("Do not use this setter, that is deprecated in API8 and will be removed in API10. Use new Rectangle(...) constructor")] 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; [Obsolete("Do not use this setter, that is deprecated in API8 and will be removed in API10. Use new Rectangle(...) constructor")] 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

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
System.Object o

The object to compare with the current object.

Returns
Type Description
Boolean

True if boxes are exactly same.

Overrides
System.Object.Equals(System.Object)
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.

Overrides
System.Object.GetHashCode()
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

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

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

System.IDisposable
System.ICloneable