Graphics.DrawCurve Método

Definição

Desenha uma spline cardinal através de um array especificado de Point estruturas.

Sobrecargas

Name Description
DrawCurve(Pen, ReadOnlySpan<PointF>, Single)

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32, Single)

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

DrawCurve(Pen, ReadOnlySpan<Point>, Int32, Int32, Single)

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

DrawCurve(Pen, PointF[], Int32, Int32, Single)

Desenha uma spline cardinal através de um array especificado de PointF estruturas usando uma tensão especificada. O desenho começa deslocado em relação ao início da matriz.

DrawCurve(Pen, Point[], Int32, Int32, Single)

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32)

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

DrawCurve(Pen, PointF[], Int32, Int32)

Desenha uma spline cardinal através de um array especificado de PointF estruturas. O desenho começa deslocado em relação ao início da matriz.

DrawCurve(Pen, PointF[], Single)

Desenha uma spline cardinal através de um array especificado de PointF estruturas usando uma tensão especificada.

DrawCurve(Pen, Point[], Single)

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

DrawCurve(Pen, ReadOnlySpan<PointF>)

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

DrawCurve(Pen, ReadOnlySpan<Point>)

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

DrawCurve(Pen, PointF[])

Desenha uma spline cardinal através de um array especificado de PointF estruturas.

DrawCurve(Pen, Point[])

Desenha uma spline cardinal através de um array especificado de Point estruturas.

DrawCurve(Pen, ReadOnlySpan<Point>, Single)

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

DrawCurve(Pen, ReadOnlySpan<PointF>, Single)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::PointF> points, float tension);
public void DrawCurve(System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.PointF> points, float tension);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.PointF> * single -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of PointF), tension As Single)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
ReadOnlySpan<PointF>

Array de Point estruturas que definem a spline.

tension
Single

Valor maior ou igual a 0,0F que especifica a tensão da curva.

Aplica-se a

DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32, Single)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::PointF> points, int offset, int numberOfSegments, float tension);
public void DrawCurve(System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.PointF> points, int offset, int numberOfSegments, float tension);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.PointF> * int * int * single -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of PointF), offset As Integer, numberOfSegments As Integer, tension As Single)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
ReadOnlySpan<PointF>

Array de Point estruturas que definem a spline.

offset
Int32

Deslocamento do primeiro elemento no array do points parâmetro até ao ponto de partida na curva.

numberOfSegments
Int32

Número de segmentos após o ponto de partida a incluir na curva.

tension
Single

Valor maior ou igual a 0,0F que especifica a tensão da curva.

Aplica-se a

DrawCurve(Pen, ReadOnlySpan<Point>, Int32, Int32, Single)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::Point> points, int offset, int numberOfSegments, float tension);
public void DrawCurve(System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.Point> points, int offset, int numberOfSegments, float tension);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.Point> * int * int * single -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of Point), offset As Integer, numberOfSegments As Integer, tension As Single)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
ReadOnlySpan<Point>

Array de Point estruturas que definem a spline.

offset
Int32

Deslocamento do primeiro elemento no array do points parâmetro até ao ponto de partida na curva.

numberOfSegments
Int32

Número de segmentos após o ponto de partida a incluir na curva.

tension
Single

Valor maior ou igual a 0,0F que especifica a tensão da curva.

Aplica-se a

DrawCurve(Pen, PointF[], Int32, Int32, Single)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de PointF estruturas usando uma tensão especificada. O desenho começa deslocado em relação ao início da matriz.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::PointF> ^ points, int offset, int numberOfSegments, float tension);
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, int offset, int numberOfSegments, float tension);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.PointF[] * int * int * single -> unit
Public Sub DrawCurve (pen As Pen, points As PointF(), offset As Integer, numberOfSegments As Integer, tension As Single)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
PointF[]

Array de PointF estruturas que definem a spline.

offset
Int32

Deslocamento do primeiro elemento no array do points parâmetro até ao ponto de partida na curva.

numberOfSegments
Int32

Número de segmentos após o ponto de partida a incluir na curva.

tension
Single

Valor maior ou igual a 0,0F que especifica a tensão da curva.

Exceções

pen é null.

-ou-

points é null.

Exemplos

O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do tratador de eventos Paint. O código executa as seguintes ações:

  • Cria canetas vermelhas e verdes.

  • Cria sete pontos para definir uma curva.

  • Desenha seis linhas retas vermelhas entre os sete pontos para formar um polígono incompleto.

  • Define o deslocamento do ponto de partida e o número de segmentos.

  • Define a tensão.

  • Desenha uma curva verde aberta (começando no terceiro ponto) através dos últimos cinco pontos.

O método define a tensão para 1,0.

private:
   void DrawCurvePointFSegmentTension( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create offset, number of segments, and tension.
      int offset = 2;
      int numSegments = 4;
      float tension = 1.0F;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, offset, numSegments, tension );
   }
private void DrawCurvePointFSegmentTension(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create offset, number of segments, and tension.
    int offset = 2;
    int numSegments = 4;
    float tension = 1.0F;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, tension);
}
Private Sub DrawCurvePointFSegmentTension(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create offset, number of segments, and tension.
    Dim offset As Integer = 2
    Dim numSegments As Integer = 4
    Dim tension As Single = 1.0F

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, _
    tension)
End Sub

Observações

Este método desenha uma spline cardinal que passa por cada ponto do array.

O array de pontos deve conter pelo menos três PointF estruturas para que a curva seja desenhada.

O valor do offset parâmetro especifica o número de elementos a saltar no array. O primeiro elemento após os elementos saltados representa o ponto de partida da curva.

O valor do numberOfSegments parâmetro especifica o número de segmentos, após o ponto de partida, a desenhar na curva. O valor do numberOfSegments parâmetro deve ser pelo menos 1. O valor do offset parâmetro mais o valor do numberOfSegments parâmetro deve ser inferior ao número de elementos no array do points parâmetro.

O tension parâmetro determina a forma da spline. Se o valor do tension parâmetro for 0,0F, este método desenha segmentos de linha reta para ligar os pontos. Normalmente, o tension parâmetro é menor ou igual a 1,0F. Valores acima de 1,0F produzem resultados invulgares.

Aplica-se a

DrawCurve(Pen, Point[], Int32, Int32, Single)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::Point> ^ points, int offset, int numberOfSegments, float tension);
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.Point[] points, int offset, int numberOfSegments, float tension);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.Point[] * int * int * single -> unit
Public Sub DrawCurve (pen As Pen, points As Point(), offset As Integer, numberOfSegments As Integer, tension As Single)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
Point[]

Array de Point estruturas que definem a spline.

offset
Int32

Deslocamento do primeiro elemento no array do points parâmetro até ao ponto de partida na curva.

numberOfSegments
Int32

Número de segmentos após o ponto de partida a incluir na curva.

tension
Single

Valor maior ou igual a 0,0F que especifica a tensão da curva.

Exceções

pen é null.

-ou-

points é null.

Exemplos

O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do tratador de eventos Paint. O código executa as seguintes ações:

  • Cria canetas vermelhas e verdes.

  • Cria sete pontos para definir uma curva.

  • Desenha seis linhas retas vermelhas entre os sete pontos para formar um polígono incompleto.

  • Define o deslocamento do ponto de partida e o número de segmentos.

  • Define a tensão.

  • Desenha uma curva verde aberta (começando no terceiro ponto) através dos últimos cinco pontos.

O método define a tensão para 1,0.

private:
   void DrawCurvePointSegmentTension( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      Point point1 = Point(50,50);
      Point point2 = Point(100,25);
      Point point3 = Point(200,5);
      Point point4 = Point(250,50);
      Point point5 = Point(300,100);
      Point point6 = Point(350,200);
      Point point7 = Point(250,250);
      array<Point>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create offset, number of segments, and tension.
      int offset = 2;
      int numSegments = 4;
      float tension = 1.0F;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, offset, numSegments, tension );
   }
private void DrawCurvePointSegmentTension(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    Point point1 = new Point(50, 50);
    Point point2 = new Point(100, 25);
    Point point3 = new Point(200, 5);
    Point point4 = new Point(250, 50);
    Point point5 = new Point(300, 100);
    Point point6 = new Point(350, 200);
    Point point7 = new Point(250, 250);
    Point[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create offset, number of segments, and tension.
    int offset = 2;
    int numSegments = 4;
    float tension = 1.0F;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, tension);
}
Private Sub DrawCurvePointSegmentTension(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New Point(50, 50)
    Dim point2 As New Point(100, 25)
    Dim point3 As New Point(200, 5)
    Dim point4 As New Point(250, 50)
    Dim point5 As New Point(300, 100)
    Dim point6 As New Point(350, 200)
    Dim point7 As New Point(250, 250)
    Dim curvePoints As Point() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create offset, number of segments, and tension.
    Dim offset As Integer = 2
    Dim numSegments As Integer = 4
    Dim tension As Single = 1.0F

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, _
    tension)
End Sub

Observações

Este método desenha uma spline cardinal que passa por cada ponto do array.

O array de pontos deve conter pelo menos três Point estruturas para que uma curva possa ser desenhada.

O valor do offset parâmetro especifica o número de elementos a saltar no array. O primeiro elemento após os elementos saltados representa o ponto de partida da curva.

O valor do numberOfSegments parâmetro especifica o número de segmentos, após o ponto de partida, a desenhar na curva. O valor do numberOfSegments parâmetro deve ser pelo menos 1. O valor do offset parâmetro mais o valor do numberOfSegments parâmetro deve ser inferior ao número de elementos no array do points parâmetro.

O tension parâmetro determina a forma da spline. Se o valor do tension parâmetro for 0,0F, este método desenha segmentos de linha reta para ligar os pontos. Normalmente, o tension parâmetro é menor ou igual a 1,0F. Valores acima de 1,0F produzem resultados invulgares.

Aplica-se a

DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::PointF> points, int offset, int numberOfSegments);
public void DrawCurve(System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.PointF> points, int offset, int numberOfSegments);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.PointF> * int * int -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of PointF), offset As Integer, numberOfSegments As Integer)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
ReadOnlySpan<PointF>

Array de Point estruturas que definem a spline.

offset
Int32

Deslocamento do primeiro elemento no array do points parâmetro até ao ponto de partida na curva.

numberOfSegments
Int32

Número de segmentos após o ponto de partida a incluir na curva.

Aplica-se a

DrawCurve(Pen, PointF[], Int32, Int32)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de PointF estruturas. O desenho começa deslocado em relação ao início da matriz.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::PointF> ^ points, int offset, int numberOfSegments);
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, int offset, int numberOfSegments);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.PointF[] * int * int -> unit
Public Sub DrawCurve (pen As Pen, points As PointF(), offset As Integer, numberOfSegments As Integer)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
PointF[]

Array de PointF estruturas que definem a spline.

offset
Int32

Deslocamento do primeiro elemento no array do points parâmetro até ao ponto de partida na curva.

numberOfSegments
Int32

Número de segmentos após o ponto de partida a incluir na curva.

Exceções

pen é null.

-ou-

points é null.

Exemplos

O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do tratador de eventos Paint. O código executa as seguintes ações:

  • Cria canetas vermelhas e verdes.

  • Cria sete pontos para definir uma curva.

  • Desenha seis linhas retas vermelhas entre os sete pontos para formar um polígono incompleto.

  • Define o deslocamento do ponto de partida e o número de segmentos.

  • Desenha uma curva verde aberta (começando no terceiro ponto) através dos últimos cinco pontos.

O método utiliza uma tensão padrão de 0,5.

private:
   void DrawCurvePointFSegments( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create offset and number of segments.
      int offset = 2;
      int numSegments = 4;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, offset, numSegments );
   }
private void DrawCurvePointFSegments(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create offset and number of segments.
    int offset = 2;
    int numSegments = 4;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments);
}
Private Sub DrawCurvePointFSegments(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create offset and number of segments.
    Dim offset As Integer = 2
    Dim numSegments As Integer = 4

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments)
End Sub

Observações

Este método desenha uma spline cardinal que passa por cada ponto do array.

O array de pontos deve conter pelo menos três PointF estruturas para que uma curva possa ser desenhada.

O valor do offset parâmetro especifica o número de elementos a saltar no array. O primeiro elemento após os elementos saltados representa o ponto de partida da curva.

O valor do numberOfSegments parâmetro especifica o número de segmentos, após o ponto de partida, a desenhar na curva. O valor do numberOfSegments parâmetro deve ser pelo menos 1. O valor do offset parâmetro mais o valor do numberOfSegments parâmetro deve ser inferior ao número de elementos no array do points parâmetro.

Este método usa uma tensão padrão de 0,5.

Aplica-se a

DrawCurve(Pen, PointF[], Single)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de PointF estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::PointF> ^ points, float tension);
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, float tension);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.PointF[] * single -> unit
Public Sub DrawCurve (pen As Pen, points As PointF(), tension As Single)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
PointF[]

Array de PointF estruturas que representam os pontos que definem a curva.

tension
Single

Valor maior ou igual a 0,0F que especifica a tensão da curva.

Exceções

pen é null.

-ou-

points é null.

Exemplos

O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do tratador de eventos Paint. O código executa as seguintes ações:

  • Cria canetas vermelhas e verdes.

  • Cria sete pontos para definir a curva.

  • Desenha seis linhas retas vermelhas entre os sete pontos para formar um polígono incompleto.

  • Cria um ambiente de tensão.

  • Desenha uma curva verde aberta e fechada através dos sete pontos.

O método utiliza uma tensão de 1,0.

private:
   void DrawCurvePointFTension( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create tension.
      float tension = 1.0F;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, tension );
   }
private void DrawCurvePointFTension(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create tension.
    float tension = 1.0F;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, tension);
}
Private Sub DrawCurvePointFTension(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create tension.
    Dim tension As Single = 1.0F

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, tension)
End Sub

Observações

Este método desenha uma spline cardinal que passa por cada ponto do array.

O array de pontos deve conter pelo menos três PointF estruturas para que uma curva possa ser desenhada.

O tension parâmetro determina a forma da spline. Se o valor do tension parâmetro for 0,0F, este método desenha segmentos de linha reta para ligar os pontos. Normalmente, o tension parâmetro é menor ou igual a 1,0F. Valores acima de 1,0F produzem resultados invulgares.

Aplica-se a

DrawCurve(Pen, Point[], Single)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::Point> ^ points, float tension);
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.Point[] points, float tension);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.Point[] * single -> unit
Public Sub DrawCurve (pen As Pen, points As Point(), tension As Single)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
Point[]

Array de Point estruturas que definem a spline.

tension
Single

Valor maior ou igual a 0,0F que especifica a tensão da curva.

Exceções

pen é null.

-ou-

points é null.

Exemplos

O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do tratador de eventos Paint. O código executa as seguintes ações:

  • Cria canetas vermelhas e verdes.

  • Cria sete pontos para definir a curva.

  • Desenha seis linhas retas vermelhas entre os sete pontos para formar um polígono incompleto.

  • Cria um ambiente de tensão.

  • Desenha uma curva verde aberta e fechada através dos sete pontos.

O método utiliza uma tensão de 1,0.

private:
   void DrawCurvePointTension( PaintEventArgs^ e )
   {

      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      Point point1 = Point(50,50);
      Point point2 = Point(100,25);
      Point point3 = Point(200,5);
      Point point4 = Point(250,50);
      Point point5 = Point(300,100);
      Point point6 = Point(350,200);
      Point point7 = Point(250,250);
      array<Point>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Create tension.
      float tension = 1.0F;

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints, tension );
   }
private void DrawCurvePointTension(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    Point point1 = new Point(50, 50);
    Point point2 = new Point(100, 25);
    Point point3 = new Point(200, 5);
    Point point4 = new Point(250, 50);
    Point point5 = new Point(300, 100);
    Point point6 = new Point(350, 200);
    Point point7 = new Point(250, 250);
    Point[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Create tension.
    float tension = 1.0F;

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, tension);
}
Private Sub DrawCurvePointTension(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New Point(50, 50)
    Dim point2 As New Point(100, 25)
    Dim point3 As New Point(200, 5)
    Dim point4 As New Point(250, 50)
    Dim point5 As New Point(300, 100)
    Dim point6 As New Point(350, 200)
    Dim point7 As New Point(250, 250)
    Dim curvePoints As Point() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Create tension.
    Dim tension As Single = 1.0F

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints, tension)
End Sub

Observações

Este método desenha uma spline cardinal que passa por cada ponto do array.

O array de pontos deve conter pelo menos três Point estruturas para que uma curva possa ser desenhada.

O tension parâmetro determina a forma da spline. Se o valor do tension parâmetro for 0,0F, este método desenha segmentos de linha reta para ligar os pontos. Normalmente, o tension parâmetro é menor ou igual a 1,0F. Valores acima de 1,0F produzem resultados invulgares.

Aplica-se a

DrawCurve(Pen, ReadOnlySpan<PointF>)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::PointF> points);
public void DrawCurve(System.Drawing.Pen pen, scoped ReadOnlySpan<System.Drawing.PointF> points);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of PointF))

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
ReadOnlySpan<PointF>

Array de Point estruturas que definem a spline.

Aplica-se a

DrawCurve(Pen, ReadOnlySpan<Point>)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::Point> points);
public void DrawCurve(System.Drawing.Pen pen, scoped ReadOnlySpan<System.Drawing.Point> points);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of Point))

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
ReadOnlySpan<Point>

Array de Point estruturas que definem a spline.

Aplica-se a

DrawCurve(Pen, PointF[])

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de PointF estruturas.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, ... cli::array <System::Drawing::PointF> ^ points);
public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::PointF> ^ points);
public void DrawCurve(System.Drawing.Pen pen, params System.Drawing.PointF[] points);
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.PointF[] -> unit
Public Sub DrawCurve (pen As Pen, ParamArray points As PointF())
Public Sub DrawCurve (pen As Pen, points As PointF())

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
PointF[]

Array de PointF estruturas que definem a spline.

Exceções

pen é null.

-ou-

points é null.

Exemplos

O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do tratador de eventos Paint. O código executa as seguintes ações:

  • Cria canetas vermelhas e verdes.

  • Cria sete pontos para definir uma curva.

  • Desenha seis linhas retas vermelhas entre os sete pontos para formar um polígono incompleto.

  • Desenha uma curva verde aberta através dos sete pontos.

O método utiliza uma tensão padrão de 0,5.

private:
   void DrawCurvePointF( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints );
   }
private void DrawCurvePointF(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints);
}
Private Sub DrawCurvePointF(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints)
End Sub

Observações

Este método desenha uma spline cardinal que passa por cada ponto do array.

O array de pontos deve conter pelo menos três PointF estruturas para que uma curva possa ser desenhada.

Este método usa uma tensão padrão de 0,5.

Aplica-se a

DrawCurve(Pen, Point[])

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, ... cli::array <System::Drawing::Point> ^ points);
public:
 void DrawCurve(System::Drawing::Pen ^ pen, cli::array <System::Drawing::Point> ^ points);
public void DrawCurve(System.Drawing.Pen pen, params System.Drawing.Point[] points);
public void DrawCurve(System.Drawing.Pen pen, System.Drawing.Point[] points);
member this.DrawCurve : System.Drawing.Pen * System.Drawing.Point[] -> unit
Public Sub DrawCurve (pen As Pen, ParamArray points As Point())
Public Sub DrawCurve (pen As Pen, points As Point())

Parâmetros

pen
Pen

Pen isso determina a cor, largura e altura da curva.

points
Point[]

Array de Point estruturas que definem a spline.

Exceções

pen é null.

-ou-

points é null.

Exemplos

O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do tratador de eventos Paint. O código executa as seguintes ações:

  • Cria canetas vermelhas e verdes.

  • Cria sete pontos para definir uma curva.

  • Desenha seis linhas retas vermelhas entre os sete pontos para formar um polígono incompleto.

  • Desenha uma curva verde aberta através dos sete pontos.

O método utiliza uma tensão padrão de 0,5.

private:
   void DrawCurvePoint( PaintEventArgs^ e )
   {
      // Create pens.
      Pen^ redPen = gcnew Pen( Color::Red,3.0f );
      Pen^ greenPen = gcnew Pen( Color::Green,3.0f );

      // Create points that define curve.
      Point point1 = Point(50,50);
      Point point2 = Point(100,25);
      Point point3 = Point(200,5);
      Point point4 = Point(250,50);
      Point point5 = Point(300,100);
      Point point6 = Point(350,200);
      Point point7 = Point(250,250);
      array<Point>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw lines between original points to screen.
      e->Graphics->DrawLines( redPen, curvePoints );

      // Draw curve to screen.
      e->Graphics->DrawCurve( greenPen, curvePoints );
   }
private void DrawCurvePoint(PaintEventArgs e)
{

    // Create pens.
    Pen redPen = new Pen(Color.Red, 3);
    Pen greenPen = new Pen(Color.Green, 3);

    // Create points that define curve.
    Point point1 = new Point(50, 50);
    Point point2 = new Point(100, 25);
    Point point3 = new Point(200, 5);
    Point point4 = new Point(250, 50);
    Point point5 = new Point(300, 100);
    Point point6 = new Point(350, 200);
    Point point7 = new Point(250, 250);
    Point[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints);

    // Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints);
}
Private Sub DrawCurvePoint(ByVal e As PaintEventArgs)

    ' Create pens.
    Dim redPen As New Pen(Color.Red, 3)
    Dim greenPen As New Pen(Color.Green, 3)

    ' Create points that define curve.
    Dim point1 As New Point(50, 50)
    Dim point2 As New Point(100, 25)
    Dim point3 As New Point(200, 5)
    Dim point4 As New Point(250, 50)
    Dim point5 As New Point(300, 100)
    Dim point6 As New Point(350, 200)
    Dim point7 As New Point(250, 250)
    Dim curvePoints As Point() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw lines between original points to screen.
    e.Graphics.DrawLines(redPen, curvePoints)

    ' Draw curve to screen.
    e.Graphics.DrawCurve(greenPen, curvePoints)
End Sub

Observações

Este método desenha uma spline cardinal que passa por cada ponto do array.

O array de pontos deve conter pelo menos três Point estruturas para que uma curva possa ser desenhada.

Este método usa uma tensão padrão de 0,5.

Aplica-se a

DrawCurve(Pen, ReadOnlySpan<Point>, Single)

Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs
Origem:
Graphics.cs

Desenha uma spline cardinal através de um array especificado de Point estruturas usando uma tensão especificada.

public:
 void DrawCurve(System::Drawing::Pen ^ pen, ReadOnlySpan<System::Drawing::Point> points, float tension);
public void DrawCurve(System.Drawing.Pen pen, ReadOnlySpan<System.Drawing.Point> points, float tension);
member this.DrawCurve : System.Drawing.Pen * ReadOnlySpan<System.Drawing.Point> * single -> unit
Public Sub DrawCurve (pen As Pen, points As ReadOnlySpan(Of Point), tension As Single)

Parâmetros

pen
Pen

Pen Isso determina a cor, largura e estilo da curva.

points
ReadOnlySpan<Point>

Array de Point estruturas que definem a spline.

tension
Single

Valor maior ou igual a 0,0F que especifica a tensão da curva.

Aplica-se a