Graphics::D rawBezier(constPen*;INT,INT,INT,INT,INT,INT,INT,INT,INT)-Methode (gdiplusgraphics.h)

Die Graphics::D rawBezier-Methode zeichnet eine Bézier-Spline.

Syntax

Status DrawBezier(
  [in] const Pen *pen,
  [in] INT       x1,
  [in] INT       y1,
  [in] INT       x2,
  [in] INT       y2,
  [in] INT       x3,
  [in] INT       y3,
  [in] INT       x4,
  [in] INT       y4
);

Parameter

[in] pen

Typ: const Pen*

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

[in] x1

Typ: INT

Eine ganze Zahl, die die x-Koordinate des Startpunkts der Bézier-Spline angibt.

[in] y1

Typ: INT

Eine ganze Zahl, die die y-Koordinate des Startpunkts der Bézier-Spline angibt.

[in] x2

Typ: INT

Ganze Zahl, die die x-Koordinate des ersten Kontrollpunkts der Bézier-Spline angibt.

[in] y2

Typ: INT

Ganze Zahl, die die y-Koordinate des ersten Kontrollpunkts der Bézier-Spline angibt

[in] x3

Typ: INT

Eine ganze Zahl, die die x-Koordinate des zweiten Kontrollpunkts der Bézier-Spline angibt.

[in] y3

Typ: INT

Ganze Zahl, die die y-Koordinate des zweiten Kontrollpunkts der Bézier-Spline angibt.

[in] x4

Typ: INT

Eine ganze Zahl, die die x-Koordinate des Endpunkts der Bézier-Spline angibt.

[in] y4

Typ: INT

Ganze Zahl, die die y-Koordinate des Endpunkts der Bézier-Spline angibt

Rückgabewert

Typ: Status

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

Wenn die Methode fehlschlägt, wird eines der anderen Elemente der Status-Enumeration zurückgegeben.

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 die Bézier-Spline biegt.

Beispiele

Das folgende Beispiel zeichnet eine Bézierkurve.


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

   // Set up the pen and curve points.
   Pen greenPen(Color(255, 0, 255, 0));
   int startPointx = 100;
   int startPointy = 100;
   int ctrlPoint1x = 200;
   int ctrlPoint1y = 10;
   int ctrlPoint2x = 350;
   int ctrlPoint2y = 50;
   int endPointx = 500;
   int endPointy = 100;

   //Draw the curve.
   graphics.DrawBezier(
   &greenPen,
   startPointx,
   startPointy,
   ctrlPoint1x,
   ctrlPoint1y,
   ctrlPoint2x,
   ctrlPoint2y,
   endPointx,
   endPointy);

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

Anforderungen

   
Unterstützte Mindestversion (Client) Windows XP, Windows 2000 Professional [nur Desktop-Apps]
Unterstützte Mindestversion (Server) Windows 2000 Server [nur Desktop-Apps]
Zielplattform Windows
Kopfzeile gdiplusgraphics.h (include Gdiplus.h)
Bibliothek Gdiplus.lib
DLL Gdiplus.dll

Weitere Informationen

Bézier Splines

Drawbezier

DrawBeziers-Methoden

Zeichnen von Bézier-Splines

Grafiken

Stift