Pen.LineJoin 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定兩條連續 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
屬性值
例外狀況
範例
以下程式碼範例展示了將 和 Width 屬性設定LineJoin在 Pen。
此範例設計用於 Windows 表單。 將程式碼貼到表單中,處理表單ShowLineJoin事件時呼叫該Paint方法,傳遞e為 PaintEventArgs 。
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
備註
線路連接是由兩條兩端相交或重疊的線所形成的公共區域。 線條接合有三種風格:斜接、斜口和圓接。 當你為物件 Pen 指定線條連接風格時,該連接風格會套用到任何 GraphicsPath 用該筆繪製的物件中所有連接的線條上。 以下圖示展示了斜角線連接範例的結果。