Describes a two-dimensional rectangle.
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
This example describes how to use the class to describe a rectangle.
The following example shows how to create and render a . The relative position and the dimensions of the rectangle are defined by a Rect structure. The relative position is 50,50 and the height and the width are both 25 creating a square. The rectangle's interior is painted with a LemonChiffon brush and its outline is painted with a Black stroke with a thickness of 1.
|How to: Round the Corners of a RectangleGeometry||To round the corners of a , set its RadiusX and RadiusY properties to a value greater than zero. The larger the values, the rounder the rectangle's corners.|
|How to: Animate a Rectangle Geometry by Using Key Frames||This example shows how to animate the Rect property of a by using key frames.|
|How to: Create a Composite Shape||This example shows how to create composite shapes using Geometry objects and display them using a Path element. In the following example, a LineGeometry, EllipseGeometry, and a are used with a GeometryGroup to create a composite shape. The geometries are then drawn using a Path element.|
|How to: Create a Shape by Using a PathGeometry||This example shows how to create a shape using the PathGeometry class. PathGeometry objects are composed of one or more PathFigure objects; each PathFigure represents a different "figure" or shape. Each PathFigure is itself composed of one or more PathSegment objects, each representing a connected portion of the figure or shape. Segment types include LineSegment, ArcSegment, and BezierSegment.|
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.