Struct Rectangle

Definition

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

Represents the location of the object bounded by a rectangle defined by coordinates of top left corner, width and height.

C#
Copy
public struct Rectangle

Constructors

View Source

Rectangle(Int32, Int32, Int32, Int32)

Initializes a new instance of the Rectangle with the specified values.

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

The x-coordinate of the upper-left corner of the rectangle.

System.Int32 y

The y-coordinate of the upper-left corner of the rectangle.

System.Int32 width

The Width of the rectangle.

System.Int32 height

The Height of the rectangle.

API Level: 3
View Source

Rectangle(Point, Size)

Initializes a new instance of the Rectangle with the specified values.

Declaration
C#
Copy
public Rectangle(Point location, Size size)
Parameters
Type Name Description
Point location

A Location that represents the upper-left corner of the rectangular region.

Size size

A Size that represents the width and height of the rectangular region.

API Level: 3

Properties

View Source

Bottom

Gets the y-coordinate of the bottom edge of the rectangle.

Declaration
C#
Copy
public int Bottom { get; }
Property Value
Type Description
System.Int32
API Level: 3
View Source

Height

Gets or sets the height of the rectangle.

Declaration
C#
Copy
public int Height { get; set; }
Property Value
Type Description
System.Int32
API Level: 3
View Source

Left

Gets the x-coordinate of the left edge of the rectangle.

Declaration
C#
Copy
public int Left { get; }
Property Value
Type Description
System.Int32
API Level: 3
View Source

Location

Gets or sets the coordinates of the upper-left corner of the rectangle.

Declaration
C#
Copy
public Point Location { get; set; }
Property Value
Type Description
Point
API Level: 3
View Source

Right

Gets the x-coordinate of the right edge of the rectangle.

Declaration
C#
Copy
public int Right { get; }
Property Value
Type Description
System.Int32
API Level: 3
View Source

Size

Gets or sets the size of the rectangle.

Declaration
C#
Copy
public Size Size { get; set; }
Property Value
Type Description
Size
API Level: 3
View Source

Top

Gets the y-coordinate of the top edge of the rectangle.

Declaration
C#
Copy
public int Top { get; }
Property Value
Type Description
System.Int32
API Level: 3
View Source

Width

Gets or sets the width of the rectangle.

Declaration
C#
Copy
public int Width { get; set; }
Property Value
Type Description
System.Int32
API Level: 3
View Source

X

Gets or sets the x-coordinate of the upper-left corner of the rectangle.

Declaration
C#
Copy
public int X { get; set; }
Property Value
Type Description
System.Int32
API Level: 3
View Source

Y

Gets or sets the y-coordinate of the upper-left corner of the rectangle.

Declaration
C#
Copy
public int Y { get; set; }
Property Value
Type Description
System.Int32
API Level: 3

Methods

View Source

Equals(Object)

Compares an object to an instance of Rectangle for equality.

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

A System.Object to compare.

Returns
Type Description
System.Boolean

true if the rectangles are equal; otherwise, false.

Overrides
System.ValueType.Equals(System.Object)
API Level: 3
View Source

GetHashCode()

Gets the hash code for this instance of Rectangle.

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

The hash code for this instance of Rectangle.

Overrides
System.ValueType.GetHashCode()
API Level: 3
View Source

ToString()

Returns a string that represents the current object.

Declaration
C#
Copy
public override string ToString()
Returns
Type Description
System.String

A string that represents the current object.

Overrides
System.ValueType.ToString()
API Level: 3

Operators

View Source

Equality(Rectangle, Rectangle)

Compares two instances of Rectangle for equality.

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

A Rectangle to compare.

Rectangle rect2

A Rectangle to compare.

Returns
Type Description
System.Boolean

true if the two instances of Rectangle are equal; otherwise false.

API Level: 3
View Source

Inequality(Rectangle, Rectangle)

Compares two instances of Rectangle for inequality.

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

A Rectangle to compare.

Rectangle rect2

A Rectangle to compare.

Returns
Type Description
System.Boolean

true if the two instances of Rectangle are not equal; otherwise false.

API Level: 3