Graphics::D rawBeziers(constPen*,constPointF*,INT)-Methode (gdiplusgraphics.h)

Die Graphics::D rawBeziers-Methode zeichnet eine Sequenz verbundener Bézier-Splines.

Syntax

Status DrawBeziers(
  const Pen    *pen,
  const PointF *points,
  INT          count
);

Parameter

pen

Zeiger auf einen Stift, der zum Zeichnen der Bézier-Splines verwendet wird.

points

Zeiger auf ein Array von PointF-Objekten , die die Start-, End- und Kontrollpunkte der Bézier-Splines angeben.

count

Ganzzahl, die die Anzahl der Elemente im Punktarray angibt.

Rückgabewert

Wenn die Methode erfolgreich ist, gibt sie OK zurück, ein Element der Status-Enumeration .

Wenn die Methode fehlschlägt, gibt sie eines der anderen Elemente der Status-Enumeration zurück.

Hinweise

Eine Bézier-Spline durchläuft ihre Kontrollpunkte nicht. Die Kontrollpunkte fungieren als Magnete und ziehen die Kurve in bestimmte Richtungen, um die Art und Weise zu beeinflussen, wie sich ein Bézier spline krümmt. Jede Bézier-Spline benötigt einen Start- und Endpunkt. Jeder Endpunkt ist der Ausgangspunkt für die nächste Bézier-Spline.

Beispiele

Im folgenden Beispiel wird ein Paar von Bézierkurven dargestellt.

VOID Example_DrawBeziers2(HDC hdc)
{
   Graphics graphics(hdc);

   // Define a Pen object and an array of PointF objects.
   Pen greenPen(Color(255, 0, 255, 0), 3);

   PointF startPoint(100.0f, 100.0f);
   PointF ctrlPoint1(200.0f, 50.0f);
   PointF ctrlPoint2(400.0f, 10.0f);
   PointF endPoint1(500.0f, 100.0f);
   PointF ctrlPoint3(600.0f, 200.0f);
   PointF ctrlPoint4(700.0f, 400.0f);
   PointF endPoint2(500.0f, 500.0f);

   PointF curvePoints[7] = {
      startPoint,
      ctrlPoint1,
      ctrlPoint2,
      endPoint1,
      ctrlPoint3,
      ctrlPoint4,
      endPoint2};

   // Draw the Bezier curves.
   graphics.DrawBeziers(&greenPen, curvePoints, 7);

   // Draw the control and end points.
   SolidBrush redBrush(Color(255, 255, 0, 0));
   graphics.FillEllipse(&redBrush, Rect(100 - 5, 100 - 5, 10, 10));
   graphics.FillEllipse(&redBrush, Rect(500 - 5, 100 - 5, 10, 10));
   graphics.FillEllipse(&redBrush, Rect(500 - 5, 500 - 5, 10, 10));
   SolidBrush blueBrush(Color(255, 0, 0, 255));
   graphics.FillEllipse(&blueBrush, Rect(200 - 5, 50 - 5, 10, 10));
   graphics.FillEllipse(&blueBrush, Rect(400 - 5, 10 - 5, 10, 10));
   graphics.FillEllipse(&blueBrush, Rect(600 - 5, 200 - 5, 10, 10));
   graphics.FillEllipse(&blueBrush, Rect(700 - 5, 400 - 5, 10, 10));
}

Anforderungen

Anforderung Wert
Header gdiplusgraphics.h

Weitere Informationen

Bézier Splines

DrawBezier-Methoden

Zeichnen von Bézier-Splines

Drawbeziers

Grafiken

Stift

Pointf