CustomLineCap Constructors
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Initialiseert een nieuw exemplaar van de CustomLineCap klasse met de opgegeven omtrek en opvulling.
Overloads
| Name | Description |
|---|---|
| CustomLineCap(GraphicsPath, GraphicsPath) |
Initialiseert een nieuw exemplaar van de CustomLineCap klasse met de opgegeven omtrek en opvulling. |
| CustomLineCap(GraphicsPath, GraphicsPath, LineCap) |
Initialiseert een nieuw exemplaar van de CustomLineCap klasse op basis van de opgegeven bestaande LineCap opsomming met het opgegeven overzicht en vul deze op. |
| CustomLineCap(GraphicsPath, GraphicsPath, LineCap, Single) |
Initialiseert een nieuw exemplaar van de CustomLineCap klasse op basis van de opgegeven bestaande LineCap opsomming met het opgegeven overzicht, de opvulling en de inset. |
CustomLineCap(GraphicsPath, GraphicsPath)
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
Initialiseert een nieuw exemplaar van de CustomLineCap klasse met de opgegeven omtrek en opvulling.
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)
Parameters
- fillPath
- GraphicsPath
Een GraphicsPath object dat de opvulling voor de aangepaste cap definieert.
- strokePath
- GraphicsPath
Een GraphicsPath object dat het overzicht van de aangepaste cap definieert.
Voorbeelden
In het volgende voorbeeld ziet u hoe u de CustomLineCap constructor gebruikt. Als u dit voorbeeld wilt uitvoeren, plakt u de code in een Windows formulier. De gebeurtenis van het formulier Paint verwerken en aanroepen DrawCaps vanuit de methode voor gebeurtenisafhandeling van het formulier Paint , waarbij deze wordt doorgegeven e als PaintEventArgs.
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
Opmerkingen
CustomLineCap maakt gebruik van een opvulmodus van 'wikkeling', ongeacht de vulmodus die is opgegeven voor de bewerking.
De fillPath parameters en strokePath parameters kunnen niet tegelijkertijd worden gebruikt. Eén parameter moet een null-waarde worden doorgegeven. Als geen van beide parameters een null-waarde wordt doorgegeven, fillPath wordt deze genegeerd. Als strokePath dat het geval is null, fillPath moet u de negatieve y-as onderscheppen.
Van toepassing op
CustomLineCap(GraphicsPath, GraphicsPath, LineCap)
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
Initialiseert een nieuw exemplaar van de CustomLineCap klasse op basis van de opgegeven bestaande LineCap opsomming met het opgegeven overzicht en vul deze op.
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)
Parameters
- fillPath
- GraphicsPath
Een GraphicsPath object dat de opvulling voor de aangepaste cap definieert.
- strokePath
- GraphicsPath
Een GraphicsPath object dat het overzicht van de aangepaste cap definieert.
- baseCap
- LineCap
De lijnlimiet van waaruit de aangepaste cap moet worden gemaakt.
Opmerkingen
CustomLineCap maakt gebruik van een opvulmodus van 'wikkeling', ongeacht de vulmodus die is opgegeven voor de bewerking.
De fillPath parameters en strokePath parameters kunnen niet tegelijkertijd worden gebruikt. Eén parameter moet een null-waarde worden doorgegeven. Als geen van beide parameters een null-waarde wordt doorgegeven, fillPath wordt deze genegeerd. Als strokePath dat het geval is null, fillPath moet u de negatieve y-as onderscheppen.
Van toepassing op
CustomLineCap(GraphicsPath, GraphicsPath, LineCap, Single)
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
- Bron:
- CustomLineCap.cs
Initialiseert een nieuw exemplaar van de CustomLineCap klasse op basis van de opgegeven bestaande LineCap opsomming met het opgegeven overzicht, de opvulling en de inset.
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)
Parameters
- fillPath
- GraphicsPath
Een GraphicsPath object dat de opvulling voor de aangepaste cap definieert.
- strokePath
- GraphicsPath
Een GraphicsPath object dat het overzicht van de aangepaste cap definieert.
- baseCap
- LineCap
De lijnlimiet van waaruit de aangepaste cap moet worden gemaakt.
- baseInset
- Single
De afstand tussen de dop en de lijn.
Opmerkingen
CustomLineCap maakt gebruik van een opvulmodus van 'wikkeling', ongeacht de vulmodus die is opgegeven voor de bewerking.
De fillPath parameters en strokePath parameters kunnen niet tegelijkertijd worden gebruikt. Eén parameter moet een null-waarde worden doorgegeven. Als geen van beide parameters een null-waarde wordt doorgegeven, fillPath wordt deze genegeerd. Als strokePath dat het geval is null, fillPath moet u de negatieve y-as onderscheppen.