Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.27 KB

rectangle.md

File metadata and controls

39 lines (26 loc) · 1.27 KB
-api-id -api-type
T:Windows.UI.Xaml.Shapes.Rectangle
winrt class

Windows.UI.Xaml.Shapes.Rectangle

-description

Draws a rectangle with a given Height and Width specified in device-independent pixel (DIP).

-xaml-syntax

<Rectangle .../>

-remarks

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.

-examples

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>

-see-also

Shape, XAML vector-based drawing sample, Draw shapes