RectHelper class

Applies to Windows and Windows Phone

Provides helper methods to evaluate or set Rect values. C# and Microsoft Visual Basic code should use members of Rect instead.

Inheritance

Object
  RectHelper

Syntax


Public NotInheritable Class RectHelper

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The RectHelper class has these types of members:

Methods

The RectHelper class has these methods. It also inherits methods from the Object class.

MethodDescription
Contains Returns whether a given Point is within the bounds of a given Rect, for a shared coordinate reference. C# and Microsoft Visual Basic code should use Contains instead. C# and Microsoft Visual Basic code should use the = operator instead.
Equals(Rect, Rect) Provides comparison of the values of two Rect values. C# and Microsoft Visual Basic code should use the = operator instead.
FromCoordinatesAndDimensions Creates a new Rect value based on the element values of a Rect structure. C# and Microsoft Visual Basic code should use Rect(Double,Double,Double,Double) instead.
FromLocationAndSize Creates a new Rect value based on a Point that specifies the upper-left origin, and a Size that specifies the width and height. C# and Microsoft Visual Basic code should use Rect(Point,Size) instead.
FromPoints Creates a new Rect value based on two points. C# and Microsoft Visual Basic code should use Rect(Point,Point) instead.
GetBottom Gets a Bottom value for the specified Rect. So long as Height is positive, Bottom is evaluated as Y + Height. C# and Microsoft Visual Basic code should use Bottom instead.
GetIsEmpty Returns whether a specified Rect is equivalent to an Empty Rect. C# and Microsoft Visual Basic code should use IsEmpty instead.
GetLeft Gets a Left value for the specified Rect. So long as Width is positive, Left is evaluated as X. C# and Microsoft Visual Basic code should use Left instead.
GetRight Gets a Right value for the specified Rect. So long as Width is positive, Right is evaluated as X + Width. C# and Microsoft Visual Basic code should use Right instead.
GetTop Gets a Top value for the specified Rect. So long as Height is positive, Top is evaluated as Y. C# and Microsoft Visual Basic code should use Top instead.
Intersect Returns the areas of two specified Rect values that intersect, as a new Rect. C# and Microsoft Visual Basic code should use Intersect instead.
Union(Rect, Point) Creates a rectangle that is exactly large enough to contain the a specified rectangle and a specified point. C# and Microsoft Visual Basic code should use Union(Point) instead.
Union(Rect, Rect) Creates a rectangle that is exactly large enough to contain the two specified rectangles. C# and Microsoft Visual Basic code should use Union(Rect) instead.

 

Properties

The RectHelper class has these properties.

PropertyAccess typeDescription

Empty

Read-onlyGets a static Rect value where the Rect has no size or position (all values 0). C# and Microsoft Visual Basic code should use Empty instead.

 

Remarks

Rect is a Windows Runtime structure that represents a rectangle's dimensions with an origin.

RectHelper is one of several Helper classes that are intended to provide utility methods for Windows Runtime structure values. C# and Visual Basic code can use members of Rect instead, because utility members are available directly on the structure due to .NET Framework runtime support. C++ code can only access the data values on Rect, for example Left. For C++ developers, approximately the same utility features that a Visual Basic developer could use directly on Rect are available in a static form on the RectHelper class.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.winmd

See also

Rect

 

 

Show:
© 2014 Microsoft