Pen.LineJoin 属性
获取或设置通过此 Pen 绘制的两条连续直线的端点的联接样式。
**命名空间:**System.Drawing
**程序集:**System.Drawing(在 system.drawing.dll 中)
语法
声明
Public Property LineJoin As LineJoin
用法
Dim instance As Pen
Dim value As LineJoin
value = instance.LineJoin
instance.LineJoin = value
public LineJoin LineJoin { get; set; }
public:
property LineJoin LineJoin {
LineJoin get ();
void set (LineJoin value);
}
/** @property */
public LineJoin get_LineJoin ()
/** @property */
public void set_LineJoin (LineJoin value)
public function get LineJoin () : LineJoin
public function set LineJoin (value : LineJoin)
属性值
一个 LineJoin,表示通过此 Pen 绘制的两条连续直线的端点的联接样式。
示例
下面的代码示例演示了在 Pen 上设置 Width 和 LineJoin 属性的效果。
此示例是针对使用 Windows 窗体而设计的。将代码粘贴到一个窗体中,然后在处理窗体的 Paint 事件时调用 ShowLineJoin
方法,并传递 e 作为 PaintEventArgs。
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
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:
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.get_DeepSkyBlue());
// Set the pen's width.
skyBluePen.set_Width(8);
// Set the LineJoin property.
skyBluePen.set_LineJoin(System.Drawing.Drawing2D.LineJoin.Bevel);
// Draw a rectangle.
e.get_Graphics().DrawRectangle(skyBluePen,
new Rectangle(40, 40, 150, 200));
//Dispose of the pen.
skyBluePen.Dispose();
} //ShowLineJoin
平台
Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0