AdjustableArrowCap 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用指定的宽度和高度初始化 AdjustableArrowCap 类的新实例。
重载
AdjustableArrowCap(Single, Single) |
使用指定的宽度和高度初始化 AdjustableArrowCap 类的新实例。 始终填充用此构造函数创建的箭头末端。 |
AdjustableArrowCap(Single, Single, Boolean) |
使用指定的宽度、高度和填充属性初始化 AdjustableArrowCap 类的新实例。 箭头末端是否填充取决于传递给 |
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对象。 此代码执行以下操作:
创建名为 AdjustableArrowCap 的对象
myArrow
。创建一Pen个名为
capPen
的对象,并将其 和 CustomEndCap 属性设置为 CustomStartCapmyArrow
等于 。DrawLine使用 方法绘制以筛选两个箭头顶住的线条。
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对象。 此代码执行以下操作:
创建名为 AdjustableArrowCap 的对象
myArrow
。创建一Pen个名为
capPen
的对象,并将其 和 CustomEndCap 属性设置为 CustomStartCapmyArrow
等于 。DrawLine使用 方法绘制以筛选两个箭头顶住的线条。
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
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈