Struct Rectangle

Definition

Namespace:
Tizen.Content.MediaContent
Assembly:
Tizen.Content.MediaContent.dll
API Level:
4

Represents the location of the object bounded by the 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
Int32 x

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

Int32 y

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

Int32 width

The width of the rectangle.

Int32 height

The height of the rectangle.

API Level: 4

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
Int32

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

API Level: 4
View Source

Height

Gets or sets the height of the rectangle.

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

The height of the rectangle.

API Level: 4
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
Int32

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

API Level: 4
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
Int32

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

API Level: 4
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
Int32

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

API Level: 4
View Source

Width

Gets or sets the width of the rectangle.

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

The width of the rectangle.

API Level: 4
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
Int32

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

API Level: 4
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
Int32

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

API Level: 4

Methods

View Source

Equals(Object)

Tests whether object is a rectangle structure with the same location and size of this rectangle structure.

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

The System.Object to compare.

Returns
Type Description
Boolean

true if object is a rectangle structure and its x, y, width, and height properties are equal to the corresponding properties of this rectangle structure; otherwise, false.

Overrides
API Level: 4
View Source

GetHashCode()

Returns the hash code for this rectangle structure.

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

An integer that represents the hash code for this rectangle.

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

ToString()

Returns a string representation of the rectangle.

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

A string representation of the current rectangle.

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

Operators

View Source

Equality(Rectangle, Rectangle)

Tests whether two rectangle structures have equal location and size.

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

The Rectangle to compare.

Rectangle rect2

The Rectangle to compare.

Returns
Type Description
Boolean

true if the two rectangle structures have equal x, y, width, and height properties; otherwise, false.

API Level: 4
View Source

Inequality(Rectangle, Rectangle)

Tests whether two rectangle structures differ in location or size.

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

The Rectangle to compare.

Rectangle rect2

The Rectangle to compare.

Returns
Type Description
Boolean

true if any of the x, y, width, or height properties of the two rectangle structures are unequal; otherwise false.

API Level: 4