CustomLineCap 생성자

정의

지정된 윤곽선 및 채우기를 사용하여 CustomLineCap 클래스의 새 인스턴스를 초기화합니다.

오버로드

CustomLineCap(GraphicsPath, GraphicsPath)

지정된 윤곽선 및 채우기를 사용하여 CustomLineCap 클래스의 새 인스턴스를 초기화합니다.

CustomLineCap(GraphicsPath, GraphicsPath, LineCap)

지정된 윤곽선 및 채우기를 사용하여 지정된 기존 CustomLineCap 열거형에서 LineCap 클래스의 새 인스턴스를 초기화합니다.

CustomLineCap(GraphicsPath, GraphicsPath, LineCap, Single)

지정된 윤곽선, 채우기 및 음각을 사용하여 지정된 기존 CustomLineCap 열거형에서 LineCap 클래스의 새 인스턴스를 초기화합니다.

CustomLineCap(GraphicsPath, GraphicsPath)

Source:
CustomLineCap.cs
Source:
CustomLineCap.cs
Source:
CustomLineCap.cs

지정된 윤곽선 및 채우기를 사용하여 CustomLineCap 클래스의 새 인스턴스를 초기화합니다.

public:
 CustomLineCap(System::Drawing::Drawing2D::GraphicsPath ^ fillPath, System::Drawing::Drawing2D::GraphicsPath ^ strokePath);
public CustomLineCap (System.Drawing.Drawing2D.GraphicsPath fillPath, System.Drawing.Drawing2D.GraphicsPath strokePath);
public CustomLineCap (System.Drawing.Drawing2D.GraphicsPath? fillPath, System.Drawing.Drawing2D.GraphicsPath? strokePath);
new System.Drawing.Drawing2D.CustomLineCap : System.Drawing.Drawing2D.GraphicsPath * System.Drawing.Drawing2D.GraphicsPath -> System.Drawing.Drawing2D.CustomLineCap
Public Sub New (fillPath As GraphicsPath, strokePath As GraphicsPath)

매개 변수

fillPath
GraphicsPath

사용자 지정 끝 모양의 채우기를 정의하는 GraphicsPath 개체입니다.

strokePath
GraphicsPath

사용자 지정 끝 모양의 윤곽선을 정의하는 GraphicsPath 개체입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다는 CustomLineCap 생성자입니다. 이 예제를 실행하려면 코드를 Windows Form에 붙여넣습니다. 양식의 Paint 이벤트를 처리하고 양식의 Paint 이벤트 처리 메서드에서 를 호출 DrawCaps 하여 으로 PaintEventArgs전달합니다e.


protected void DrawCaps(PaintEventArgs e)
{
    GraphicsPath hPath = new GraphicsPath();

    // Create the outline for our custom end cap.
    hPath.AddLine(new Point(0, 0), new Point(0, 5));
    hPath.AddLine(new Point(0, 5), new Point(5, 1));
    hPath.AddLine(new Point(5, 1), new Point(3, 1));

    // Construct the hook-shaped end cap.
    CustomLineCap HookCap = new CustomLineCap(null, hPath);

    // Set the start cap and end cap of the HookCap to be rounded.
    HookCap.SetStrokeCaps(LineCap.Round, LineCap.Round);

    // Create a pen and set end custom start and end
    // caps to the hook cap.
    Pen customCapPen = new Pen(Color.Black, 5);
    customCapPen.CustomStartCap = HookCap;
    customCapPen.CustomEndCap = HookCap;

    // Create a second pen using the start and end caps from
    // the hook cap.
    Pen capPen = new Pen(Color.Red, 10);
    LineCap startCap;
    LineCap endCap;
    HookCap.GetStrokeCaps(out startCap, out endCap);
    capPen.StartCap = startCap;
    capPen.EndCap = endCap;

    // Create a line to draw.
    Point[] points = { new Point(100, 100), new Point(200, 50), 
        new Point(250, 300) };

    // Draw the lines.
    e.Graphics.DrawLines(capPen, points);
    e.Graphics.DrawLines(customCapPen, points);
}
Protected Sub DrawCaps(ByVal e As PaintEventArgs)
    Dim hPath As New GraphicsPath()

    ' Create the outline for our custom end cap.
    hPath.AddLine(New Point(0, 0), New Point(0, 5))
    hPath.AddLine(New Point(0, 5), New Point(5, 1))
    hPath.AddLine(New Point(5, 1), New Point(3, 1))

    ' Construct the hook-shaped end cap.
    Dim HookCap As New CustomLineCap(Nothing, hPath)

    ' Set the start cap and end cap of the HookCap to be rounded.
    HookCap.SetStrokeCaps(LineCap.Round, LineCap.Round)

    ' Create a pen and set end custom start and end
    ' caps to the hook cap.
    Dim customCapPen As New Pen(Color.Black, 5)
    customCapPen.CustomStartCap = HookCap
    customCapPen.CustomEndCap = HookCap

    ' Create a second pen using the start and end caps from
    ' the hook cap.
    Dim capPen As New Pen(Color.Red, 10)
    Dim startCap As LineCap
    Dim endCap As LineCap
    HookCap.GetStrokeCaps(startCap, endCap)
    capPen.StartCap = startCap
    capPen.EndCap = endCap

    ' Create a line to draw.
    Dim points As Point() = {New Point(100, 100), New Point(200, 50), _
        New Point(250, 300)}

    ' Draw the lines.
    e.Graphics.DrawLines(capPen, points)
    e.Graphics.DrawLines(customCapPen, points)

End Sub

설명

CustomLineCap 는 작업에 지정된 채우기 모드에 관계없이 "권"의 채우기 모드를 사용합니다.

strokePath 매개 변수는 fillPath 동시에 사용할 수 없습니다. 하나의 매개 변수는 null 값으로 전달되어야 합니다. 두 매개 변수가 모두 null 값 fillPath 으로 전달되지 않으면 는 무시됩니다. 가 이 nullfillPathstrokePath 음의 y축을 가로채야 합니다.

적용 대상

CustomLineCap(GraphicsPath, GraphicsPath, LineCap)

Source:
CustomLineCap.cs
Source:
CustomLineCap.cs
Source:
CustomLineCap.cs

지정된 윤곽선 및 채우기를 사용하여 지정된 기존 CustomLineCap 열거형에서 LineCap 클래스의 새 인스턴스를 초기화합니다.

public:
 CustomLineCap(System::Drawing::Drawing2D::GraphicsPath ^ fillPath, System::Drawing::Drawing2D::GraphicsPath ^ strokePath, System::Drawing::Drawing2D::LineCap baseCap);
public CustomLineCap (System.Drawing.Drawing2D.GraphicsPath fillPath, System.Drawing.Drawing2D.GraphicsPath strokePath, System.Drawing.Drawing2D.LineCap baseCap);
public CustomLineCap (System.Drawing.Drawing2D.GraphicsPath? fillPath, System.Drawing.Drawing2D.GraphicsPath? strokePath, System.Drawing.Drawing2D.LineCap baseCap);
new System.Drawing.Drawing2D.CustomLineCap : System.Drawing.Drawing2D.GraphicsPath * System.Drawing.Drawing2D.GraphicsPath * System.Drawing.Drawing2D.LineCap -> System.Drawing.Drawing2D.CustomLineCap
Public Sub New (fillPath As GraphicsPath, strokePath As GraphicsPath, baseCap As LineCap)

매개 변수

fillPath
GraphicsPath

사용자 지정 끝 모양의 채우기를 정의하는 GraphicsPath 개체입니다.

strokePath
GraphicsPath

사용자 지정 끝 모양의 윤곽선을 정의하는 GraphicsPath 개체입니다.

baseCap
LineCap

사용자 지정 끝 모양을 만들 선 끝 모양입니다.

설명

CustomLineCap 는 작업에 지정된 채우기 모드에 관계없이 "권"의 채우기 모드를 사용합니다.

strokePath 매개 변수는 fillPath 동시에 사용할 수 없습니다. 하나의 매개 변수는 null 값으로 전달되어야 합니다. 두 매개 변수가 모두 null 값 fillPath 으로 전달되지 않으면 는 무시됩니다. 가 이 nullfillPathstrokePath 음의 y축을 가로채야 합니다.

적용 대상

CustomLineCap(GraphicsPath, GraphicsPath, LineCap, Single)

Source:
CustomLineCap.cs
Source:
CustomLineCap.cs
Source:
CustomLineCap.cs

지정된 윤곽선, 채우기 및 음각을 사용하여 지정된 기존 CustomLineCap 열거형에서 LineCap 클래스의 새 인스턴스를 초기화합니다.

public:
 CustomLineCap(System::Drawing::Drawing2D::GraphicsPath ^ fillPath, System::Drawing::Drawing2D::GraphicsPath ^ strokePath, System::Drawing::Drawing2D::LineCap baseCap, float baseInset);
public CustomLineCap (System.Drawing.Drawing2D.GraphicsPath fillPath, System.Drawing.Drawing2D.GraphicsPath strokePath, System.Drawing.Drawing2D.LineCap baseCap, float baseInset);
public CustomLineCap (System.Drawing.Drawing2D.GraphicsPath? fillPath, System.Drawing.Drawing2D.GraphicsPath? strokePath, System.Drawing.Drawing2D.LineCap baseCap, float baseInset);
new System.Drawing.Drawing2D.CustomLineCap : System.Drawing.Drawing2D.GraphicsPath * System.Drawing.Drawing2D.GraphicsPath * System.Drawing.Drawing2D.LineCap * single -> System.Drawing.Drawing2D.CustomLineCap
Public Sub New (fillPath As GraphicsPath, strokePath As GraphicsPath, baseCap As LineCap, baseInset As Single)

매개 변수

fillPath
GraphicsPath

사용자 지정 끝 모양의 채우기를 정의하는 GraphicsPath 개체입니다.

strokePath
GraphicsPath

사용자 지정 끝 모양의 윤곽선을 정의하는 GraphicsPath 개체입니다.

baseCap
LineCap

사용자 지정 끝 모양을 만들 선 끝 모양입니다.

baseInset
Single

끝 모양과 선 사이의 거리입니다.

설명

CustomLineCap 는 작업에 지정된 채우기 모드에 관계없이 "권"의 채우기 모드를 사용합니다.

strokePath 매개 변수는 fillPath 동시에 사용할 수 없습니다. 하나의 매개 변수는 null 값으로 전달되어야 합니다. 두 매개 변수가 모두 null 값 fillPath 으로 전달되지 않으면 는 무시됩니다. 가 이 nullfillPathstrokePath 음의 y축을 가로채야 합니다.

적용 대상