O'Reilly logo

Microsoft® Silverlight® Edition: Programming Windows® Phone 7 by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Caps, Joins, and Dashes

When you’re displaying thick lines, you might want a little different appearance on the ends of the lines. These are known as line caps—“caps” like a hat. The available caps are members of the PenLineCap enumeration: Flat (the default), Square, Round, and Triangle. Set the StrokeStartLineCap property to one of these values for the cap at the beginning of the line, and set StrokeEndLineCap for the cap at the end. Here are Round and Triangle capping off a 30-pixel line:

<Grid Background="LightCyan">
    <Polyline Points=" 50 100, 300 200,
                      300 400"
              Stroke="HotPink"
              StrokeThickness="30"
              StrokeStartLineCap="Round"
              StrokeEndLineCap="Triangle" />
</Grid>

The difference between Flat and Square might not be obvious at first. To better ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required