다음을 통해 공유


RectangleD Struct

Definition

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

public value class RectangleD
[System.ComponentModel.TypeConverter(typeof(Microsoft.VisualStudio.Modeling.Diagrams.RectangleDConverter))]
[System.Serializable]
public struct RectangleD
[<System.ComponentModel.TypeConverter(typeof(Microsoft.VisualStudio.Modeling.Diagrams.RectangleDConverter))>]
[<System.Serializable>]
type RectangleD = struct
Public Structure RectangleD
Inheritance
RectangleD
Attributes

Remarks

A rectangle is defined by its width, height, and upper-left corner.

Constructors

RectangleD(Double, Double, Double, Double)

Initializes a new instance of the RectangleD class with the specified location and size.

RectangleD(PointD, SizeD)

Initializes a new instance of the RectangleD class with the specified location and size.

Fields

Empty

Represents an instance of the RectangleD with its numeric properties initialized to zero.

Properties

Bottom

Gets the y-coordinate of the bottom edge of this RectangleD structure

Center

Gets the coordinates of the center of this RectangleD structure.

Height

Gets or sets the height of this RectangleD structure.

IsEmpty

Tests whether all numeric properties of this RectangleD have values of zero.

Left

Gets the x-coordinate of the left edge of this RectangleD structure.

Location

Gets or sets the coordinates of the upper-left corner of this RectangleD structure.

Right

Gets the x-coordinate of the right edge of this RectangleD structure.

Size

Gets or sets the size of this RectangleD.

Top

Gets the y-coordinate of the top edge of this RectangleD structure.

Width

Gets or sets the width of this RectangleD structure.

X

Gets or sets the x-coordinate of the upper-left corner of this RectangleD structure.

Y

Gets or sets the y-coordinate of the upper-left corner of this RectangleD structure.

Methods

Contains(Double, Double)

Determines if the specified point is contained within this RectangleD structure.

Contains(PointD)

Determines if the specified point is contained within this RectangleD structure.

Contains(RectangleD)

Determines if the rectangular region represented by rectangle is entirely contained within this RectangleD structure.

ContainsX(Double)

Determines if the X coordinate is contained within this RectangleD structure.

ContainsY(Double)

Determines if the Y coordinate is contained within this RectangleD structure.

Equals(Object)

Overridden. Tests whether obj is a RectangleD with the same location and size of this RectangleD.

GetHashCode()

Gets the hash code for this RectangleD structure. For information about the use of hash codes, see Object.GetHashCode.

Inflate(Double, Double)

Inflates this RectangleD structure by the specified amount.

Inflate(RectangleD, Double, Double)

Creates and returns an inflated copy of the specified RectangleD structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.

Inflate(SizeD)

Inflates this RectangleF by the specified amount.

Intersect(RectangleD, RectangleD)

Returns a RectangleD structure that represents the intersection of two rectangles. If there is no intersection, null is returned.

Intersect(RectangleD)

Replaces this RectangleD structure with the intersection of itself and the specified RectangleD structure.

IntersectsWith(RectangleD)

Determines if this rectangle intersects with rectangle.

IsOnPerimeter(PointD)
Offset(Double, Double)

Adjusts the location of this rectangle by the specified amount.

Offset(PointD)

Adjusts the location of this rectangle by the specified amount.

PerimeterTranslation(Double, Double)
PerimeterTranslation(PointD)
ToRectangleF(RectangleD)

Converts the specified RectangleD to a RectangleF.

ToString()

Returns a string formatted like this: X=x, Y=y, Width=width, Height=height

Union(RectangleD, RectangleD)

Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.

Operators

Equality(RectangleD, RectangleD)

Tests whether two RectangleD structures have equal location and size.

Implicit(Rectangle to RectangleD)

Converts the specified Rectangle to a RectangleD.

Implicit(RectangleF to RectangleD)

Converts the specified RectangleF to a RectangleD.

Inequality(RectangleD, RectangleD)

Tests whether two RectangleD structures differ in location or size.

Applies to