更新:2007 年 11 月
本範例說明如何修改開放式 Shape 項目開頭或結尾的圖案。若要變更開放式 Shape 開頭的端點,請使用其 StrokeStartLineCap 屬性。若要變更開放式 Shape 結尾的端點,請使用其 StrokeEndLineCap 屬性。若要檢視可用的線條端點,請查看 PenLineCap 列舉。
注意事項: |
|---|
下列範例會繪製四個 Polyline 項目,並在每個項目的端點使用不同一組的形狀。
範例
<TextBlock Grid.Column="3" Grid.Row="0" Grid.ColumnSpan="2">
<Bold>Line Caps</Bold>
</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="1">Flat</TextBlock>
<Polyline
Points="50,50 75,30 100,100 130,40"
Stroke="Red"
StrokeThickness="20"
StrokeStartLineCap="Flat"
StrokeEndLineCap="Flat"
Grid.Row="1" Grid.Column="4"/>
<TextBlock Grid.Column="3" Grid.Row="2">Square</TextBlock>
<Polyline
Points="50,50 75,30 100,100 130,40"
Stroke="Red"
StrokeThickness="20"
StrokeStartLineCap="Square"
StrokeEndLineCap="Square"
Grid.Row="2" Grid.Column="4"/>
<TextBlock Grid.Column="3" Grid.Row="3">Round</TextBlock>
<Polyline
Points="50,50 75,30 100,100 130,40"
Stroke="Red"
StrokeThickness="20"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"
Grid.Row="3" Grid.Column="4"/>
<TextBlock Grid.Column="3" Grid.Row="4">Triangle</TextBlock>
<Polyline
Points="50,50 75,30 100,100 130,40"
Stroke="Red"
StrokeThickness="20"
StrokeStartLineCap="Triangle"
StrokeEndLineCap="Triangle"
Grid.Row="4" Grid.Column="4"/>
這個範例是較大範例的一部分;如需完整範例,請參閱圖案項目範例。
注意事項: