CustomLineCap 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 윤곽선과 채우기를 CustomLineCap 사용하여 클래스의 새 인스턴스를 초기화합니다.
오버로드
| Name | Description |
|---|---|
| CustomLineCap(GraphicsPath, GraphicsPath) |
지정된 윤곽선과 채우기를 CustomLineCap 사용하여 클래스의 새 인스턴스를 초기화합니다. |
| CustomLineCap(GraphicsPath, GraphicsPath, LineCap) |
지정된 윤곽선과 채우기를 사용하여 지정된 기존 LineCap 열거형에서 클래스의 새 인스턴스 CustomLineCap 를 초기화합니다. |
| CustomLineCap(GraphicsPath, GraphicsPath, LineCap, Single) |
지정된 윤곽선, 채우기 및 삽입을 사용하여 지정된 기존 LineCap 열거형에서 클래스의 새 인스턴스 CustomLineCap 를 초기화합니다. |
CustomLineCap(GraphicsPath, GraphicsPath)
지정된 윤곽선과 채우기를 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);
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 으로 전달되지 않으면 무시됩니다. 이 nullfillPath 경우 strokePath 음수 y축을 가로채야 합니다.
적용 대상
CustomLineCap(GraphicsPath, GraphicsPath, LineCap)
지정된 윤곽선과 채우기를 사용하여 지정된 기존 LineCap 열거형에서 클래스의 새 인스턴스 CustomLineCap 를 초기화합니다.
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 으로 전달되지 않으면 무시됩니다. 이 nullfillPath 경우 strokePath 음수 y축을 가로채야 합니다.
적용 대상
CustomLineCap(GraphicsPath, GraphicsPath, LineCap, Single)
지정된 윤곽선, 채우기 및 삽입을 사용하여 지정된 기존 LineCap 열거형에서 클래스의 새 인스턴스 CustomLineCap 를 초기화합니다.
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 으로 전달되지 않으면 무시됩니다. 이 nullfillPath 경우 strokePath 음수 y축을 가로채야 합니다.