-api-id | -api-type |
---|---|
T:Windows.UI.Xaml.Shapes.Rectangle |
winrt class |
Draws a rectangle with a given Height and Width specified in device-independent pixel (DIP).
<Rectangle .../>
You can set the Fill property to give the shape a background fill, like a solid color, gradient, or image. You can set the Stroke and other related stroke properties to specify the look of the shape's outline.
This example shows how to create a Rectangle in XAML and set some of its common properties as attribute values.
<Canvas>
<Rectangle Width="100" Height="100" Fill="Blue" Stroke="Red"
Canvas.Top="20" Canvas.Left="20" StrokeThickness="3" />
</Canvas>