Graphics::D rawBezier(constPen*,INT,INT,INT,INT,INT,INT,INT,INT) メソッド (gdiplusgraphics.h)

Graphics::D rawBezier メソッドは、ベジエ スプラインを描画します。

構文

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

パラメーター

[in] pen

種類: const Pen*

ベジエ スプラインの描画に使用されるペンへのポインター。

[in] x1

型: INT

ベジエ スプラインの始点の x 座標を指定する整数。

[in] y1

型: INT

ベジエ スプラインの始点の y 座標を指定する整数。

[in] x2

型: INT

ベジエ スプラインの最初のコントロール ポイントの x 座標を指定する整数。

[in] y2

型: INT

ベジエ スプラインの最初のコントロール ポイントの y 座標を指定する整数

[in] x3

型: INT

ベジエ スプラインの 2 番目のコントロール ポイントの x 座標を指定する整数。

[in] y3

型: INT

ベジエ スプラインの 2 番目のコントロール ポイントの y 座標を指定する整数。

[in] x4

型: INT

ベジエ スプラインの終点の x 座標を指定する整数。

[in] y4

型: INT

ベジエ スプラインの終了点の y 座標を指定する整数

戻り値

種類: 状態

メソッドが成功した場合は、 Status 列挙の要素である Ok を返します。

メソッドが失敗した場合は、 Status 列挙体の他の要素のいずれかを返します。

解説

ベジエ スプラインはコントロール ポイントを通過しません。 コントロール ポイントは磁石として機能し、ベジェ スプラインの曲げ方に影響を与えるために曲線を特定の方向に引っ張ります。

次の例では、ベジエ曲線を描画します。


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

要件

   
サポートされている最小のクライアント Windows XP、Windows 2000 Professional [デスクトップ アプリのみ]
サポートされている最小のサーバー Windows 2000 Server [デスクトップ アプリのみ]
対象プラットフォーム Windows
ヘッダー gdiplusgraphics.h (Gdiplus.h を含む)
Library Gdiplus.lib
[DLL] Gdiplus.dll

関連項目

ベジエ スプライン

DrawBezier

DrawBeziers メソッド

ベジエ スプラインの描画

グラフィックス

ペン