[]
        
(Showing Draft Content)

C1.Win.Interop.Rect

Rect Struct

Stores a set of four double values that represent the location and size of a rectangle.

Namespace: C1.Win.Interop
Assembly: C1.Win.8.dll
Syntax
public struct Rect

Constructors

Name Description
Rect(Point, Point)
Rect(Point, Size)

Initializes a new instance of the Rect structure.

Rect(double, double, double, double)

Initializes a new instance of the Rect structure.

Properties

Name Description
Bottom

Gets the Y coordinate of the bottom edge of the current Rect structure.

BottomLeft

Gets the coordinates of the bottom left corner of the current Rect structure.

BottomRight

Gets the coordinates of the bottom right corner of the current Rect structure.

Empty

Represents an empty instance of the Rect structure.

Height

Gets or sets the height of the current Rect structure.

IsEmpty

Gets a value indicating whether the Width and Height properties of the current Rect structure have zero values.

Left

Gets the X coordinate of the left edge of the current Rect structure.

Location

Gets or sets the coordinates of the top left corner of the current Rect structure.

Right

Gets the X coordinate of the right edge of the current Rect structure.

Size

Gets or sets the size of the current Rect structure.

Top

Gets the Y coordinate of the top edge of the current Rect structure.

TopLeft

Gets the coordinates of the top left corner of the current Rect structure.

TopRight

Gets the coordinates of the top right corner of the current Rect structure.

Width

Gets or sets the width of the current Rect structure.

X

Gets or sets the X coordinate of the top left corner of the current Rect structure.

Y

Gets or sets the Y coordinate of the top left corner of the current Rect structure.

Methods

Name Description
Contains(Point)

Tests whether the specified point is contained within the current Rect.

Contains(Rect)

Tests whether the specified rectangle is entirely contained within the current Rect.

Contains(double, double)

Tests whether a point specified by its coordinates is contained within the current Rect.

Deflate(Thickness)

Deflates the current Rect by the specified amounts provided as Thickness.

Equals(object)

Indicates whether this instance and a specified object are equal.

FromLTRB(double, double, double, double)

Creates a Rect structure based on the coordinates of its top-left and bottom-right corners.

GetHashCode()

Returns the hash code for this instance.

Inflate(Rect, double, double)

Creates a new Rect structure from another RectangleD, inflated by the specified amounts vertically and horizontally.

Inflate(Size)

Inflates the current Rect by a specified Size.

Inflate(double, double)

Inflates the current Rect by specified horizontal and vertical amounts.

Inflate(double, double, double, double)

Inflates the current Rect by the specified amounts on four sides.

Intersect(Rect)

Replaces the current Rect structure with the intersection of itself and another Rect.

Intersect(Rect, Rect)

Creates a new Rect structure representing the intersection of two RectangleD structures. (The intersection may be empty, in which case Empty is returned.)

IntersectsWith(Rect)

Tests whether the current Rect intersects with another.

Offset(Point)

Offsets the location of the current Rect by horizontal and vertical amounts specified by a Point.

Offset(Rect, Point)

Adjusts the location of this rectangle by the specified amount.

Offset(double, double)

Offsets the location of the current Rect by specified horizontal and vertical amounts.

Parse(string, out Rect, bool)

Converts a string to a Rect structure.

ToRectangle()

Converts the current Rect to a Rectangle.

ToRectangleF()

Converts the current Rect to a RectangleF.

ToString()

Converts the current Rect structure to a human-readable string representing it.

Union(Rect, Rect)

Creates a new Rect structure representing the smallest possible rectangle containing the two specified rectangles.

Operators

Name Description
operator ==(Rect, Rect)

Indicates whether two Rect structures are equal.

implicit operator Rect(Rectangle)

Converts a Rectangle to a Rect.

implicit operator Rect(RectangleF)

Converts a RectangleF to a Rect.

operator !=(Rect, Rect)

Indicates whether two Rect structures are not equal.