閱讀英文版本 編輯

分享方式:


AdjustableArrowCap Constructors

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Initializes a new instance of the AdjustableArrowCap class with the specified width and height.

Overloads

AdjustableArrowCap(Single, Single)

Initializes a new instance of the AdjustableArrowCap class with the specified width and height. The arrow end caps created with this constructor are always filled.

AdjustableArrowCap(Single, Single, Boolean)

Initializes a new instance of the AdjustableArrowCap class with the specified width, height, and fill property. Whether an arrow end cap is filled depends on the argument passed to the isFilled parameter.

AdjustableArrowCap(Single, Single)

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

Initializes a new instance of the AdjustableArrowCap class with the specified width and height. The arrow end caps created with this constructor are always filled.

C#
public AdjustableArrowCap(float width, float height);

Parameters

width
Single

The width of the arrow.

height
Single

The height of the arrow.

Examples

The following example is designed for use with Windows Forms, and it requires PaintEventArgs e, an OnPaint event object. The code performs the following actions:

C#
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);
}

Applies to

.NET 10 (package-provided) 和其他版本
產品 版本
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

AdjustableArrowCap(Single, Single, Boolean)

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

Initializes a new instance of the AdjustableArrowCap class with the specified width, height, and fill property. Whether an arrow end cap is filled depends on the argument passed to the isFilled parameter.

C#
public AdjustableArrowCap(float width, float height, bool isFilled);

Parameters

width
Single

The width of the arrow.

height
Single

The height of the arrow.

isFilled
Boolean

true to fill the arrow cap; otherwise, false.

Examples

The following example is designed for use with Windows Forms, and it requires PaintEventArgs e, an OnPaint event object. The code performs the following actions:

C#
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);
}

Applies to

.NET 10 (package-provided) 和其他版本
產品 版本
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10