Graphics::D rawBezier(constPen*,constPoint&,constPoint&,constPoint&,constPoint&)-Methode (gdiplusgraphics.h)

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

Syntax

Status DrawBezier(
  [in]      const Pen     *pen,
  [in, ref] const Point & pt1,
  [in, ref] const Point & pt2,
  [in, ref] const Point & pt3,
  [in, ref] const Point & pt4
);

Parameter

[in] pen

Typ: const Pen*

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

[in, ref] pt1

Typ: const POINT

Verweis auf den Startpunkt der Bézier-Spline.

[in, ref] pt2

Typ: const POINT

Verweis auf den ersten Steuerungspunkt der Bézier-Spline.

[in, ref] pt3

Typ: const POINT

Verweis auf den zweiten Steuerungspunkt der Bézier-Spline.

[in, ref] pt4

Typ: const POINT

Verweis auf den Endpunkt der Bézier-Spline.

Rückgabewert

Typ: Status

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 die Bézier-Spline krümmt.

Beispiele

Das folgende Beispiel zeichnet eine Bézierkurve.


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

   // Set up the pen and curve points.
   Pen greenPen(Color(255, 0, 255, 0));
   Point startPoint(100, 100);
   Point controlPoint1(200, 10);
   Point controlPoint2(350, 50);
   Point endPoint(500, 100);

   //Draw the curve.
   graphics.DrawBezier(&greenPen, startPoint, controlPoint1, controlPoint2, endPoint);

   //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

Point