Share via


AdjustableArrowCap 构造函数

定义

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

重载

AdjustableArrowCap(Single, Single)

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

AdjustableArrowCap(Single, Single, Boolean)

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

AdjustableArrowCap(Single, Single)

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 窗体 一起使用,它需要 PaintEventArgse事件OnPaint对象。 此代码执行以下操作:

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

使用指定的宽度、高度和填充属性初始化 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 窗体 一起使用,它需要 PaintEventArgse事件OnPaint对象。 此代码执行以下操作:

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

适用于