AdjustableArrowCap 构造函数

定义

使用指定的宽度和高度初始化 AdjustableArrowCap 类的新实例。

重载

AdjustableArrowCap(Single, Single)

使用指定的宽度和高度初始化 AdjustableArrowCap 类的新实例。 始终填充使用此构造函数创建的箭头尾帽。

AdjustableArrowCap(Single, Single, Boolean)

使用指定的宽度、高度和填充属性初始化 AdjustableArrowCap 类的新实例。 箭头端帽是否填充取决于传递给 isFilled 参数的参数。

AdjustableArrowCap(Single, Single)

Source:
AdjustableArrowCap.cs
Source:
AdjustableArrowCap.cs
Source:
AdjustableArrowCap.cs
Source:
AdjustableArrowCap.cs
Source:
AdjustableArrowCap.cs

使用指定的宽度和高度初始化 AdjustableArrowCap 类的新实例。 始终填充使用此构造函数创建的箭头尾帽。

public:
 AdjustableArrowCap(float width, float height);
public AdjustableArrowCap (float width, float height);
new System.Drawing.Drawing2D.AdjustableArrowCap : single * single -> System.Drawing.Drawing2D.AdjustableArrowCap
Public Sub New (width As Single, height As Single)

参数

width
Single

箭头的宽度。

height
Single

箭头的高度。

示例

以下示例旨在与 Windows 窗体一起使用,它需要 PaintEventArgseOnPaint 事件对象。 该代码执行以下操作:

public:
   void ConstructAdjArrowCap1( PaintEventArgs^ e )
   {
      AdjustableArrowCap^ myArrow = gcnew AdjustableArrowCap( 6,6 );
      Pen^ capPen = gcnew Pen( Color::Black );
      capPen->CustomStartCap = myArrow;
      capPen->CustomEndCap = myArrow;
      e->Graphics->DrawLine( capPen, 50, 50, 200, 50 );
   }
public void ConstructAdjArrowCap1(PaintEventArgs e)
{     
    AdjustableArrowCap myArrow = new AdjustableArrowCap(6, 6);
    Pen capPen = new Pen(Color.Black);
    capPen.CustomStartCap = myArrow;
    capPen.CustomEndCap = myArrow;
    e.Graphics.DrawLine(capPen, 50, 50, 200, 50);
}
Public Sub ConstructAdjArrowCap1(ByVal e As PaintEventArgs)
    Dim myArrow As New AdjustableArrowCap(6, 6)
    Dim customArrow As CustomLineCap = myArrow
    Dim capPen As New Pen(Color.Black)
    capPen.CustomStartCap = myArrow
    capPen.CustomEndCap = myArrow
    e.Graphics.DrawLine(capPen, 50, 50, 200, 50)
End Sub

适用于

AdjustableArrowCap(Single, Single, Boolean)

Source:
AdjustableArrowCap.cs
Source:
AdjustableArrowCap.cs
Source:
AdjustableArrowCap.cs
Source:
AdjustableArrowCap.cs
Source:
AdjustableArrowCap.cs

使用指定的宽度、高度和填充属性初始化 AdjustableArrowCap 类的新实例。 箭头端帽是否填充取决于传递给 isFilled 参数的参数。

public:
 AdjustableArrowCap(float width, float height, bool isFilled);
public AdjustableArrowCap (float width, float height, bool isFilled);
new System.Drawing.Drawing2D.AdjustableArrowCap : single * single * bool -> System.Drawing.Drawing2D.AdjustableArrowCap
Public Sub New (width As Single, height As Single, isFilled As Boolean)

参数

width
Single

箭头的宽度。

height
Single

箭头的高度。

isFilled
Boolean

true 填充箭头帽;否则,false

示例

以下示例旨在与 Windows 窗体一起使用,它需要 PaintEventArgseOnPaint 事件对象。 该代码执行以下操作:

public:
   void ConstructAdjArrowCap2( PaintEventArgs^ e )
   {
      AdjustableArrowCap^ myArrow = gcnew AdjustableArrowCap( 6,6,false );
      Pen^ capPen = gcnew Pen( Color::Black );
      capPen->CustomStartCap = myArrow;
      capPen->CustomEndCap = myArrow;
      e->Graphics->DrawLine( capPen, 50, 50, 200, 50 );
   }
public void ConstructAdjArrowCap2(PaintEventArgs e)
{     
    AdjustableArrowCap myArrow = new AdjustableArrowCap(6, 6, false);
    Pen capPen = new Pen(Color.Black);
    capPen.CustomStartCap = myArrow;
    capPen.CustomEndCap = myArrow;
    e.Graphics.DrawLine(capPen, 50, 50, 200, 50);
}
Public Sub ConstructAdjArrowCap2(ByVal e As PaintEventArgs)
    Dim myArrow As New AdjustableArrowCap(6, 6, False)
    Dim customArrow As CustomLineCap = myArrow
    Dim capPen As New Pen(Color.Black)
    capPen.CustomStartCap = myArrow
    capPen.CustomEndCap = myArrow
    e.Graphics.DrawLine(capPen, 50, 50, 200, 50)
End Sub

适用于