共用方式為


Pen.EndLineCap 屬性

定義

取得或設定筆劃的端點要使用的形狀類型。

public:
 property System::Windows::Media::PenLineCap EndLineCap { System::Windows::Media::PenLineCap get(); void set(System::Windows::Media::PenLineCap value); };
public System.Windows.Media.PenLineCap EndLineCap { get; set; }
member this.EndLineCap : System.Windows.Media.PenLineCap with get, set
Public Property EndLineCap As PenLineCap

屬性值

PenLineCap

筆劃端點使用的形狀類型。 預設值是 Flat

範例

下列範例示範如何使用 StartLineCapEndLineCap 屬性,在筆劃的一邊建立四捨五入的結尾,以及筆劃另一邊的三角形結尾。

<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>

備註

相依性屬性資訊

識別碼欄位 EndLineCapProperty
中繼資料屬性設定為 true

適用於

另請參閱