Graphics ::D rawBezier(constPen*,constPointF&,constPointF&,constPointF&,constPointF&) method (gdiplusgraphics.h)

La méthode Graphics ::D rawBezier dessine une spline de Bézier.

Syntaxe

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

Paramètres

[in] pen

Type : stylet* const

Pointeur vers un stylet utilisé pour dessiner la spline de Bézier.

[in, ref] pt1

Type : const POINTF

Référence au point de départ de la spline de Bézier.

[in, ref] pt2

Type : const POINTF

Référence au premier point de contrôle de la spline de Bézier.

[in, ref] pt3

Type : const POINTF

Référence au deuxième point de contrôle de la spline de Bézier.

[in, ref] pt4

Type : const POINTF

Référence au point de terminaison de la spline de Bézier.

Valeur retournée

Type : État

Si la méthode réussit, elle retourne Ok, qui est un élément de l’énumération Status .

Si la méthode échoue, elle retourne l’un des autres éléments de l’énumération Status .

Remarques

Une spline de Bézier ne passe pas par ses points de contrôle. Les points de contrôle agissent comme des aimants, tirant la courbe dans certaines directions pour influencer la façon dont la spline de Bézier se plie.

Exemples

L’exemple suivant dessine une courbe de Bézier.


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

   // Set up the pen and curve points.
   Pen greenPen(Color(255, 0, 255, 0));
   PointF startPoint(100.0f, 100.0f);
   PointF controlPoint1(200.0f, 10.0f);
   PointF controlPoint2(350.0f, 50.0f);
   PointF endPoint(500.0f, 100.0f);

   //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);
}

Configuration requise

Condition requise Valeur
Client minimal pris en charge Windows XP, Windows 2000 Professionnel [applications de bureau uniquement]
Serveur minimal pris en charge Windows 2000 Server [applications de bureau uniquement]
Plateforme cible Windows
En-tête gdiplusgraphics.h (include Gdiplus.h)
Bibliothèque Gdiplus.lib
DLL Gdiplus.dll

Voir aussi

Bézier Splines

DrawBezier

DrawBeziers, méthodes

Dessin De Bézier Splines

Graphismes

Stylet

Pointf