EndLineCap Property
Collapse the table of content
Expand the table of content

Pen.EndLineCap Property

 

Gets or sets the type of shape to use at the end of a stroke.

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public PenLineCap EndLineCap { get; set; }

Property Value

Type: System.Windows.Media.PenLineCap

The type of shape that ends the stroke. The default value is Flat.

Identifier field

EndLineCapProperty

Metadata properties set to true

None

The following example shows how to use the StartLineCap and EndLineCap properties to create a rounded end on one side of a stroke and a triangular end on the other side of the stroke.

<Page 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <StackPanel Margin="20">

    <Canvas Margin="100"  Width="100" Height="100">
      <Canvas.Background>
        <DrawingBrush>
          <DrawingBrush.Drawing>
            <GeometryDrawing>
              <GeometryDrawing.Geometry>
                <LineGeometry StartPoint="10,10" EndPoint="50,100" />
              </GeometryDrawing.Geometry>
              <GeometryDrawing.Pen>

                <!-- This Pen specifies a round line cap at the beginning of
                     the line and a triangular line cap at the end of the line. -->
                <Pen Brush="Blue" Thickness="8"  StartLineCap="Round" 
                     EndLineCap="Triangle" />
              </GeometryDrawing.Pen>
            </GeometryDrawing>
          </DrawingBrush.Drawing>
        </DrawingBrush>
      </Canvas.Background>
    </Canvas>

  </StackPanel>

</Page>

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft