Search Results for

    Show / Hide Table of Contents

    Struct Rect

    Represents the offset and size of a rectangle.

    Implements
    IEquatable<Rect>
    Namespace: OpenCV.Net
    Assembly: OpenCV.Net.dll
    Syntax
    public struct Rect : IEquatable<Rect>

    Constructors

    | Improve this Doc View Source

    Rect(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 Source

    Height

    The height of the rectangle.

    Declaration
    public int Height
    Field Value
    Type Description
    Int32
    | Improve this Doc View Source

    Width

    The width of the rectangle.

    Declaration
    public int Width
    Field Value
    Type Description
    Int32
    | Improve this Doc View Source

    X

    The x-coordinate of the top-left corner.

    Declaration
    public int X
    Field Value
    Type Description
    Int32
    | Improve this Doc View Source

    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 Source

    Equals(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 other has the same offset and size as this instance; otherwise, false.

    | Improve this Doc View Source

    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 to test.

    Returns
    Type Description
    Boolean

    true if obj is a Rect and has the same offset and size as this Rect; otherwise, false.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    ToString()

    Creates a representation of this Rect structure.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A containing the X and Y offset as well as the Width and Height of this Rect structure.

    Operators

    | Improve this Doc View Source

    Equality(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 left and right have equal offset and size; otherwise, false.

    | Improve this Doc View Source

    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 left and right differ in offset or size; false if left and right are equal.

    Implements

    IEquatable<>
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX