Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Int32Rect Structure
Collapse the table of content
Expand the table of content

Int32Rect Structure

Describes the width, height, and location of an integer rectangle.

Namespace:  System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public struct Int32Rect : IFormattable
<object property="X,Y,Width,Height"/>
- or 
<object property="Empty"/>
You can also use whitespace instead of commas to delimit values. Whitespace can also be used with a comma delimited value set.

XAML Values



The x-coordinate of the top-left corner of the rectangle.



The y-coordinate of the top-left corner of the rectangle.



The width of the rectangle.



The height of the rectangle.

The Int32Rect type exposes the following members.

Public methodInt32RectInitializes a new instance of an Int32Rect with the specified X and Y coordinates and the specified Width and Height.

Public propertyStatic memberEmptyGets the empty rectangle, a special value that represents a rectangle with no position or area.
Public propertyHasAreaGets a value that indicates whether the Width and Height properties of the Int32Rect are greater than 0.
Public propertyHeightGets or sets the height of the rectangle.
Public propertyIsEmptyGets a value indicating whether the rectangle is empty.
Public propertyWidthGets or sets the width of the rectangle.
Public propertyXGets or sets the x-coordinate of the top-left corner of the rectangle.
Public propertyYGets or sets the y-coordinate of the top-left corner of the rectangle.

Public methodEquals(Int32Rect)Determines whether the specified rectangle is equal to this rectangle.
Public methodEquals(Object)Determines whether the specified rectangle is equal to this rectangle. (Overrides ValueType.Equals(Object).)
Public methodStatic memberEquals(Int32Rect, Int32Rect)Determines whether the specified rectangles are equal.
Public methodGetHashCodeCreates a hash code from this rectangle's X, Y, Width, and Height values. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberParseCreates an Int32Rect structure from the specified String representation.
Public methodToString()Creates a string representation of this Int32Rect. (Overrides ValueType.ToString().)
Public methodToString(IFormatProvider)Creates a string representation of this Int32Rect based on the supplied IFormatProvider.

Public operatorStatic memberEqualityCompares two rectangles for exact equality.
Public operatorStatic memberInequalityCompares two rectangles for inequality.

Explicit interface implemetationPrivate methodIFormattable.ToStringFormats the value of the current instance using the specified format.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft