Drawing Shapes: The Ellipse

The Ellipse element is not properly a user control because it is actually a geometric shape. It is useful to understand how the element works because you can use it when creating your custom control templates. The following XAML code declares an Ellipse:

<Ellipse Width="150" Height="80" Stroke="Red"         StrokeThickness="3" Fill="Orange"/>

The most important properties are Width and Height that define dimensions. Stroke defines the color that surrounds the ellipse, and StrokeThickness is a value indicating the stroke depth. As with other geometric shapes, Ellipse background can be assigned via the Fill property. Figure 29.6 shows the drawn ellipse.

FIGURE 29.6 Drawing and filling ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.