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

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

構文

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

パラメーター

[in] pen

種類: const Pen*

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

[in, ref] pt1

型: const POINT

ベジエ スプラインの始点への参照。

[in, ref] pt2

型: const POINT

ベジエ スプラインの最初のコントロール ポイントへの参照。

[in, ref] pt3

型: const POINT

ベジエ スプラインの 2 番目のコントロール ポイントへの参照。

[in, ref] pt4

型: const POINT

ベジエ スプラインの終点への参照。

戻り値

種類: 状態

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

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

注釈

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

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


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

要件

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

こちらもご覧ください

ベジエ スプライン

DrawBezier

DrawBeziers メソッド

ベジエ スプラインの描画

グラフィックス

ペン

Point