RectHelper RectHelper RectHelper RectHelper Class

Definition

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

public : sealed class RectHelper : IRectHelper
struct winrt::Windows::UI::Xaml::RectHelper : IRectHelper
public sealed class RectHelper : IRectHelper
Public NotInheritable Class RectHelper Implements IRectHelper
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 Microsoft 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 Microsoft Visual Basic developer could use directly on Rect are available in a static form on the RectHelper class.

Properties

Empty Empty Empty Empty

Gets 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.

Methods

Contains(Rect, Point) Contains(Rect, Point) Contains(Rect, Point) Contains(Rect, Point)

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) Equals(Rect, Rect) Equals(Rect, Rect) Equals(Rect, Rect)

Provides comparison of the values of two Rect values. C# and Microsoft Visual Basic code should use the = operator instead.

FromCoordinatesAndDimensions(Single, Single, Single, Single) FromCoordinatesAndDimensions(Single, Single, Single, Single) FromCoordinatesAndDimensions(Single, Single, Single, Single) FromCoordinatesAndDimensions(Single, Single, Single, Single)

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(Point, Size) FromLocationAndSize(Point, Size) FromLocationAndSize(Point, Size) FromLocationAndSize(Point, Size)

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(Point, Point) FromPoints(Point, Point) FromPoints(Point, Point) FromPoints(Point, Point)

Creates a new Rect value based on two points. C# and Microsoft Visual Basic code should use Rect(Point,Point) instead.

GetBottom(Rect) GetBottom(Rect) GetBottom(Rect) GetBottom(Rect)

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(Rect) GetIsEmpty(Rect) GetIsEmpty(Rect) GetIsEmpty(Rect)

Returns whether a specified Rect is equivalent to an Empty Rect. C# and Microsoft Visual Basic code should use IsEmpty instead.

GetLeft(Rect) GetLeft(Rect) GetLeft(Rect) GetLeft(Rect)

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(Rect) GetRight(Rect) GetRight(Rect) GetRight(Rect)

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(Rect) GetTop(Rect) GetTop(Rect) GetTop(Rect)

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(Rect, Rect) Intersect(Rect, Rect) Intersect(Rect, Rect) Intersect(Rect, Rect)

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) Union(Rect, Point) Union(Rect, Point) 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) Union(Rect, Rect) Union(Rect, Rect) 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.

See Also