Now let's add some creativity to the Pen. Pen supports several more properties including StartLineCap, EndLineCap,DashCap, LineJoin, and MiterLimit.StartLineCap and EndLineCap define the type of shape to use at the beginning and end of a stroke. The value can beflat, square, triangle and round. LineJoin property defines the type of joint used at the vertices of a shape's outline.The value of LineJoin is type of PenLineJoin enumeration that has Miter, Bevel, and Round values. The followingcode snippet sets StartLineCap, EndLineCap, and LineJoin properties to Triangle, Round, and Bevel respectively.
The DashCap attribute property defines how the ends of each dash are drawn. DashStyle property defines the styleof dash used in a pen. The value of DashStyle is a member of DashStyles class that can be a Dash, DashDot,DashDotDot, Dot, or Solid. MiterLimit propert represents the limit on the ratio of the miter length to half this pen'sThickness.The following code snippet sets DashStyle, DashCap, and MiterLimit properties to DotDot, Triangle, and 0respectively.
The code snippet in Listing 33 sets some of these properties using attributes of the Pen element,