RectangleGeometry
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Describes a two-dimensional rectangular geometry.
<RectangleGeometry .../>
Properties
FillRule (Geometry), Name (DependencyObject), RadiusX (RectangleGeometry), RadiusY (RectangleGeometry), Rect (RectangleGeometry), Transform (Geometry)
Remarks
FillRule (Geometry) is technically a property inherited from the base Geometry object, but setting it has no effect on a RectangleGeometry object.
Example
The following example shows how to create and render a RectangleGeometry object. The position and dimensions of the rectangle are defined by a Rect property value, provided as a string. The position is 50,50 and the height and width are both 25, which creates a square. The following illustration shows the output of the example.
<Canvas
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml">
<Path Fill="LemonChiffon" Stroke="Black" StrokeThickness="1">
<Path.Data>
<RectangleGeometry Rect="50,50,25,25" />
</Path.Data>
</Path>
</Canvas>