Export (0) Print
Expand All
2 out of 3 rated this helpful - Rate this topic

RectangleF Structure

Stores a set of four floating-point numbers that represent the location and size of a rectangle. For more advanced region functions, use a Region object.

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)
[SerializableAttribute]
public value class RectangleF

The RectangleF type exposes the following members.

  NameDescription
Public methodRectangleF(PointF, SizeF)Initializes a new instance of the RectangleF class with the specified location and size.
Public methodRectangleF(Single, Single, Single, Single)Initializes a new instance of the RectangleF class with the specified location and size.
Top
  NameDescription
Public propertyBottomGets the y-coordinate that is the sum of Y and Height of this RectangleF structure.
Public propertyHeightGets or sets the height of this RectangleF structure.
Public propertyIsEmptyTests whether the Width or Height property of this RectangleF has a value of zero.
Public propertyLeftGets the x-coordinate of the left edge of this RectangleF structure.
Public propertyLocationGets or sets the coordinates of the upper-left corner of this RectangleF structure.
Public propertyRightGets the x-coordinate that is the sum of X and Width of this RectangleF structure.
Public propertySizeGets or sets the size of this RectangleF.
Public propertyTopGets the y-coordinate of the top edge of this RectangleF structure.
Public propertyWidthGets or sets the width of this RectangleF structure.
Public propertyXGets or sets the x-coordinate of the upper-left corner of this RectangleF structure.
Public propertyYGets or sets the y-coordinate of the upper-left corner of this RectangleF structure.
Top
  NameDescription
Public methodContains(PointF)Determines if the specified point is contained within this RectangleF structure.
Public methodContains(RectangleF)Determines if the rectangular region represented by rect is entirely contained within this RectangleF structure.
Public methodContains(Single, Single)Determines if the specified point is contained within this RectangleF structure.
Public methodEqualsTests whether obj is a RectangleF with the same location and size of this RectangleF. (Overrides ValueType::Equals(Object).)
Public methodStatic memberFromLTRBCreates a RectangleF structure with upper-left corner and lower-right corner at the specified locations.
Public methodGetHashCodeGets the hash code for this RectangleF structure. For information about the use of hash codes, see Object.GetHashCode. (Overrides ValueType::GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInflate(SizeF)Enlarges this RectangleF by the specified amount.
Public methodInflate(Single, Single)Enlarges this RectangleF structure by the specified amount.
Public methodStatic memberInflate(RectangleF, Single, Single)Creates and returns an enlarged copy of the specified RectangleF structure. The copy is enlarged by the specified amount and the original rectangle remains unmodified.
Public methodIntersect(RectangleF)Replaces this RectangleF structure with the intersection of itself and the specified RectangleF structure.
Public methodStatic memberIntersect(RectangleF, RectangleF)Returns a RectangleF structure that represents the intersection of two rectangles. If there is no intersection, and empty RectangleF is returned.
Public methodIntersectsWithDetermines if this rectangle intersects with rect.
Public methodOffset(PointF)Adjusts the location of this rectangle by the specified amount.
Public methodOffset(Single, Single)Adjusts the location of this rectangle by the specified amount.
Public methodToStringConverts the Location and Size of this RectangleF to a human-readable string. (Overrides ValueType::ToString().)
Public methodStatic memberUnionCreates the smallest possible third rectangle that can contain both of two rectangles that form a union.
Top
  NameDescription
Public operatorStatic memberEqualityTests whether two RectangleF structures have equal location and size.
Public operatorStatic memberImplicit(Rectangle to RectangleF)Converts the specified Rectangle structure to a RectangleF structure.
Public operatorStatic memberInequalityTests whether two RectangleF structures differ in location or size.
Top
  NameDescription
Public fieldStatic memberEmptyRepresents an instance of the RectangleF class with its members uninitialized.
Top

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

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.