Share via


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

'Declaration
<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
Public method RectangleD(PointD, SizeD) Initializes a new instance of the RectangleD class with the specified location and size.
Public method RectangleD(Double, Double, Double, Double) Initializes a new instance of the RectangleD class with the specified location and size.

Top

Properties

  Name Description
Public property Bottom Gets the y-coordinate of the bottom edge of this RectangleD structure
Public property Center Gets the coordinates of the center of this RectangleD structure.
Public property Height Gets or sets the height of this RectangleD structure.
Public property IsEmpty Tests whether all numeric properties of this RectangleD have values of zero.
Public property Left Gets the x-coordinate of the left edge of this RectangleD structure.
Public property Location Gets or sets the coordinates of the upper-left corner of this RectangleD structure.
Public property Right Gets the x-coordinate of the right edge of this RectangleD structure.
Public property Size Gets or sets the size of this RectangleD.
Public property Top Gets the y-coordinate of the top edge of this RectangleD structure.
Public property Width Gets or sets the width of this RectangleD structure.
Public property X Gets or sets the x-coordinate of the upper-left corner of this RectangleD structure.
Public property Y Gets or sets the y-coordinate of the upper-left corner of this RectangleD structure.

Top

Methods

  Name Description
Public method Contains(PointD) Determines if the specified point is contained within this RectangleD structure.
Public method Contains(RectangleD) Determines if the rectangular region represented by rectangle is entirely contained within this RectangleD structure.
Public method Contains(Double, Double) Determines if the specified point is contained within this RectangleD structure.
Public method ContainsX Determines if the X coordinate is contained within this RectangleD structure.
Public method ContainsY Determines if the Y coordinate is contained within this RectangleD structure.
Public method Equals Overridden. Tests whether obj is a RectangleD with the same location and size of this RectangleD. (Overrides ValueType.Equals(Object).)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Gets the hash code for this RectangleD structure. For information about the use of hash codes, see Object.GetHashCode. (Overrides ValueType.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Inflate(SizeD) Inflates this RectangleF by the specified amount.
Public method Inflate(Double, Double) Inflates this RectangleD structure by the specified amount.
Public methodStatic member 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.
Public method Intersect(RectangleD) Replaces this RectangleD structure with the intersection of itself and the specified RectangleD structure.
Public methodStatic member Intersect(RectangleD, RectangleD) Returns a RectangleD structure that represents the intersection of two rectangles. If there is no intersection, null is returned.
Public method IntersectsWith Determines if this rectangle intersects with rectangle.
Public method IsOnPerimeter
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Offset(PointD) Adjusts the location of this rectangle by the specified amount.
Public method Offset(Double, Double) Adjusts the location of this rectangle by the specified amount.
Public method PerimeterTranslation(PointD)
Public method PerimeterTranslation(Double, Double)
Public methodStatic member ToRectangleF Converts the specified RectangleD to a RectangleF.
Public method ToString Returns a string formatted like this: X=x, Y=y, Width=width, Height=height (Overrides ValueType.ToString().)
Public methodStatic member Union Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.

Top

Operators

  Name Description
Public operatorStatic member Equality Tests whether two RectangleD structures have equal location and size.
Public operatorStatic member Implicit(Rectangle to RectangleD)
Public operatorStatic member Implicit(RectangleF to RectangleD)
Public operatorStatic member Inequality Tests whether two RectangleD structures differ in location or size.

Top

Fields

  Name Description
Public fieldStatic member 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.

See Also

Reference

Microsoft.VisualStudio.Modeling.Diagrams Namespace