Pen.LineJoin 屬性

定義

取得或設定以這個 Pen 所繪製之兩條連續直線末端的接合樣式。

public:
 property System::Drawing::Drawing2D::LineJoin LineJoin { System::Drawing::Drawing2D::LineJoin get(); void set(System::Drawing::Drawing2D::LineJoin value); };
public System.Drawing.Drawing2D.LineJoin LineJoin { get; set; }
member this.LineJoin : System.Drawing.Drawing2D.LineJoin with get, set
Public Property LineJoin As LineJoin

屬性值

LineJoin,表示以這個 Pen 所繪製之兩條連續直線末端的接合樣式。

例外狀況

LineJoin 屬性設定於不可變動的 Pen 上,例如 Pens 類別傳回的項目。

範例

下列程式碼範例示範在 上 Pen 設定 WidthLineJoin 屬性的效果。

此範例的設計目的是要與Windows Forms搭配使用。 將程式碼貼到表單中,並在處理表單的事件 Paint 時呼叫 ShowLineJoin 方法,並傳遞 ePaintEventArgs

private:
   void ShowLineJoin( PaintEventArgs^ e )
   {
      // Create a new pen.
      Pen^ skyBluePen = gcnew Pen( Brushes::DeepSkyBlue );

      // Set the pen's width.
      skyBluePen->Width = 8.0F;

      // Set the LineJoin property.
      skyBluePen->LineJoin = System::Drawing::Drawing2D::LineJoin::Bevel;

      // Draw a rectangle.
      e->Graphics->DrawRectangle( skyBluePen, Rectangle(40,40,150,200) );

      //Dispose of the pen.
      delete skyBluePen;
   }
private void ShowLineJoin(PaintEventArgs e)
{

    // Create a new pen.
    Pen skyBluePen = new Pen(Brushes.DeepSkyBlue);

    // Set the pen's width.
    skyBluePen.Width = 8.0F;

    // Set the LineJoin property.
    skyBluePen.LineJoin = System.Drawing.Drawing2D.LineJoin.Bevel;

    // Draw a rectangle.
    e.Graphics.DrawRectangle(skyBluePen, 
        new Rectangle(40, 40, 150, 200));

    //Dispose of the pen.
    skyBluePen.Dispose();
}
Private Sub ShowLineJoin(ByVal e As PaintEventArgs)

    ' Create a new pen.
    Dim skyBluePen As New Pen(Brushes.DeepSkyBlue)

    ' Set the pen's width.
    skyBluePen.Width = 8.0F

    ' Set the LineJoin property.
    skyBluePen.LineJoin = Drawing2D.LineJoin.Bevel

    ' Draw a rectangle.
    e.Graphics.DrawRectangle(skyBluePen, _
        New Rectangle(40, 40, 150, 200))

    'Dispose of the pen.
    skyBluePen.Dispose()

End Sub

備註

線條聯結是由兩行組成,其結尾符合或重迭。 有三種線條聯結樣式:miter、浮凸和圓角。 當您指定 Pen 物件的線條聯結樣式時,該聯結樣式會套用至使用該手寫筆繪製之任何 GraphicsPath 物件中的所有連接線。 下圖顯示浮凸線條聯結範例的結果。

手寫筆

適用於