Struct Rect
Represents the offset and size of a rectangle.
Implements
Namespace: OpenCV.Net
Assembly: OpenCV.Net.dll
Syntax
public struct Rect : IEquatable<Rect>
Constructors
| Improve this Doc View SourceRect(Int32, Int32, Int32, Int32)
Initializes a new instance of the Rect structure from the specified offset and dimensions.
Declaration
public Rect(int x, int y, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | The x-coordinate of the top-left corner. |
Int32 | y | The y-coordinate of the top-left corner (or bottom-left depending on image origin). |
Int32 | width | The width of the rectangle. |
Int32 | height | The height of the rectangle. |
Fields
| Improve this Doc View SourceHeight
The height of the rectangle.
Declaration
public int Height
Field Value
Type | Description |
---|---|
Int32 |
Width
The width of the rectangle.
Declaration
public int Width
Field Value
Type | Description |
---|---|
Int32 |
X
The x-coordinate of the top-left corner.
Declaration
public int X
Field Value
Type | Description |
---|---|
Int32 |
Y
The y-coordinate of the top-left corner (or bottom-left depending on image origin).
Declaration
public int Y
Field Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceEquals(Rect)
Returns a value indicating whether this instance has the same offset and size as a specified Rect structure.
Declaration
public bool Equals(Rect other)
Parameters
Type | Name | Description |
---|---|---|
Rect | other | The Rect structure to compare to this instance. |
Returns
Type | Description |
---|---|
Boolean | true if |
Equals(Object)
Tests to see whether the specified object is a Rect structure with the same offset and size as this Rect structure.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The |
Returns
Type | Description |
---|---|
Boolean | true if |
GetHashCode()
Returns a hash code for this Rect structure.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | An integer value that specifies a hash value for this Rect structure. |
ToString()
Creates a
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A |
Operators
| Improve this Doc View SourceEquality(Rect, Rect)
Tests whether two Rect structures are equal.
Declaration
public static bool operator ==(Rect left, Rect right)
Parameters
Type | Name | Description |
---|---|---|
Rect | left | The Rect structure on the left of the equality operator. |
Rect | right | The Rect structure on the right of the equality operator. |
Returns
Type | Description |
---|---|
Boolean | true if |
Inequality(Rect, Rect)
Tests whether two Rect structures are different.
Declaration
public static bool operator !=(Rect left, Rect right)
Parameters
Type | Name | Description |
---|---|---|
Rect | left | The Rect structure on the left of the inequality operator. |
Rect | right | The Rect structure on the right of the inequality operator. |
Returns
Type | Description |
---|---|
Boolean | true if |