Stores a set of four integers that represent the location and size of a rectangle

Hierarchy (view full)

Constructors

  • Initializes a new instance of the System.Drawing.Rectangle class with the specified location and size.

    Parameters

    • x: number | Int32

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

    • y: number | Int32

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

    • width: number | Int32

      The width of the rectangle.

    • height: number | Int32

      The height of the rectangle.

    Returns Rectangle

Accessors

Methods

  • Casts this object to the specified type. Throws error on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns T1

  • Determines if the rectangular region represented by rect is entirely contained within this System.Drawing.Rectangle structure.

    Parameters

    Returns boolean

    This method returns true if the rectangular region represented by rect is entirely contained within this System.Drawing.Rectangle structure; otherwise false.

  • Determines if the specified point is contained within this System.Drawing.Rectangle structure.

    Parameters

    • x: number | Int32

      The x-coordinate of the point to test.

    • y: number | Int32

      The y-coordinate of the point to test.

    Returns boolean

    This method returns true if the point defined by x and y is contained within this System.Drawing.Rectangle structure; otherwise false.

  • Determines whether the specified object is equal to the current object.

    Parameters

    • obj: any

      The object to compare with the current object.

    Returns boolean

    true if the specified object is equal to the current object; otherwise, false.

  • Serves as the default hash function.

    Returns number

    A hash code for the current object.

  • Determines if this rectangle intersects with rect.

    Parameters

    Returns boolean

    This method returns true if there is any intersection, otherwise false.

  • Adjusts the location of this rectangle by the specified amount.

    Parameters

    • x: number | Int32

      The horizontal offset.

    • y: number | Int32

      The vertical offset.

    Returns void

  • Returns a string that represents the current object.

    Returns string

    A string that represents the current object.

  • Casts this object to the specified type. Returns null on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns null | T1

  • Determines whether the specified object instances are considered equal.

    Parameters

    • objA: any

      The first object to compare.

    • objB: any

      The second object to compare.

    Returns boolean

    true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.