Struct Rectangle
Definition
- Namespace:
- Tizen.Multimedia
- Assembly:
- Tizen.Multimedia.dll
Represents the location of the object bounded by a rectangle defined by coordinates of top left corner, width and height.
public struct Rectangle
Constructors
View SourceRectangle(int, int, int, int)
Initializes a new instance of the Rectangle with the specified values.
Declaration
public Rectangle(int x, int y, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
int | x | The x-coordinate of the upper-left corner of the rectangle. |
int | y | The y-coordinate of the upper-left corner of the rectangle. |
int | width | The Width of the rectangle. |
int | height | The Height of the rectangle. |
Rectangle(Point, Size)
Initializes a new instance of the Rectangle with the specified values.
Declaration
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. |
Properties
View SourceBottom
Gets the y-coordinate of the bottom edge of the rectangle.
Declaration
public int Bottom { get; }
Property Value
Type | Description |
---|---|
int |
Height
Gets or sets the height of the rectangle.
Declaration
public int Height { get; set; }
Property Value
Type | Description |
---|---|
int |
Left
Gets the x-coordinate of the left edge of the rectangle.
Declaration
public int Left { get; }
Property Value
Type | Description |
---|---|
int |
Location
Gets or sets the coordinates of the upper-left corner of the rectangle.
Declaration
public Point Location { get; set; }
Property Value
Type | Description |
---|---|
Point |
Right
Gets the x-coordinate of the right edge of the rectangle.
Declaration
public int Right { get; }
Property Value
Type | Description |
---|---|
int |
Size
Gets or sets the size of the rectangle.
Declaration
public Size Size { get; set; }
Property Value
Type | Description |
---|---|
Size |
Top
Gets the y-coordinate of the top edge of the rectangle.
Declaration
public int Top { get; }
Property Value
Type | Description |
---|---|
int |
Width
Gets or sets the width of the rectangle.
Declaration
public int Width { get; set; }
Property Value
Type | Description |
---|---|
int |
X
Gets or sets the x-coordinate of the upper-left corner of the rectangle.
Declaration
public int X { get; set; }
Property Value
Type | Description |
---|---|
int |
Y
Gets or sets the y-coordinate of the upper-left corner of the rectangle.
Declaration
public int Y { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
View SourceEquals(object)
Compares an object to an instance of Rectangle for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | A object to compare. |
Returns
Type | Description |
---|---|
bool | true if the rectangles are equal; otherwise, false. |
Overrides
GetHashCode()
Gets the hash code for this instance of Rectangle.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code for this instance of Rectangle. |
Overrides
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |
Overrides
Operators
View Sourceoperator ==(Rectangle, Rectangle)
Compares two instances of Rectangle for equality.
Declaration
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 |
---|---|
bool | true if the two instances of Rectangle are equal; otherwise false. |
operator !=(Rectangle, Rectangle)
Compares two instances of Rectangle for inequality.
Declaration
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 |
---|---|
bool | true if the two instances of Rectangle are not equal; otherwise false. |