RectangleD Structure
Stores a set of four doubles that represent the location and size of a rectangle.
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
Syntax
'宣告
<SerializableAttribute> _
<TypeConverterAttribute(GetType(RectangleDConverter))> _
Public Structure RectangleD
[SerializableAttribute]
[TypeConverterAttribute(typeof(RectangleDConverter))]
public struct RectangleD
[SerializableAttribute]
[TypeConverterAttribute(typeof(RectangleDConverter))]
public value class RectangleD
[<Sealed>]
[<SerializableAttribute>]
[<TypeConverterAttribute(typeof(RectangleDConverter))>]
type RectangleD = struct end
JScript supports the use of structures, but not the declaration of new ones.
The RectangleD type exposes the following members.
Constructors
Name | Description | |
---|---|---|
RectangleD(PointD, SizeD) | Initializes a new instance of the RectangleD class with the specified location and size. | |
RectangleD(Double, Double, Double, Double) | Initializes a new instance of the RectangleD class with the specified location and size. |
Top
Properties
Name | Description | |
---|---|---|
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. |
Top
Methods
Name | Description | |
---|---|---|
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. | |
Contains(Double, Double) | Determines if the specified point is contained within this RectangleD structure. | |
ContainsX | Determines if the X coordinate is contained within this RectangleD structure. | |
ContainsY | Determines if the Y coordinate is contained within this RectangleD structure. | |
Equals | Overridden. Tests whether obj is a RectangleD with the same location and size of this RectangleD. (Overrides ValueType.Equals(Object).) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Gets the hash code for this RectangleD structure. For information about the use of hash codes, see Object.GetHashCode. (Overrides ValueType.GetHashCode().) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Inflate(SizeD) | Inflates this RectangleF by the specified amount. | |
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. | |
Intersect(RectangleD) | Replaces this RectangleD structure with the intersection of itself and the specified RectangleD structure. | |
Intersect(RectangleD, RectangleD) | Returns a RectangleD structure that represents the intersection of two rectangles. If there is no intersection, null is returned. | |
IntersectsWith | Determines if this rectangle intersects with rectangle. | |
IsOnPerimeter | ||
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Offset(PointD) | Adjusts the location of this rectangle by the specified amount. | |
Offset(Double, Double) | Adjusts the location of this rectangle by the specified amount. | |
PerimeterTranslation(PointD) | ||
PerimeterTranslation(Double, Double) | ||
ToRectangleF | Converts the specified RectangleD to a RectangleF. | |
ToString | Returns a string formatted like this: X=x, Y=y, Width=width, Height=height (Overrides ValueType.ToString().) | |
Union | Creates the smallest possible third rectangle that can contain both of two rectangles that form a union. |
Top
Operators
Name | Description | |
---|---|---|
Equality | Tests whether two RectangleD structures have equal location and size. | |
Implicit(Rectangle to RectangleD) | ||
Implicit(RectangleF to RectangleD) | ||
Inequality | Tests whether two RectangleD structures differ in location or size. |
Top
Fields
Name | Description | |
---|---|---|
Empty | Represents an instance of the RectangleD with its numeric properties initialized to zero. |
Top
Remarks
A rectangle is defined by its width, height, and upper-left corner.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.