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

Graphics::D rawCurve メソッドは、カーディナル スプラインを描画します。

構文

Status DrawCurve(
  [in] const Pen    *pen,
  [in] const PointF *points,
  [in] INT          count,
  [in] REAL         tension
);

パラメーター

[in] pen

種類: const Pen*

カーディナル スプラインの描画に使用されるペンへのポインター。

[in] points

型: const PointF*

カーディナル スプラインが通過する座標を指定する PointF オブジェクトの配列へのポインター。

[in] count

型: INT

points 配列内の要素の数を指定する整数。

[in] tension

種類: REAL

カーディナル スプラインの座標を通して曲線がどれだけ緊密に曲がっているかを示す実数。

戻り値

種類: 状態

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

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

解説

セグメントは、カーディナル スプライン内の 2 つの連続する点を接続する曲線として定義されます。 各セグメントの終了点は、次のセグメントの開始点です。

次の例では、カーディナル スプラインを描画します。

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

   // Define a Pen object and an array of PointF objects.
   Pen greenPen(Color::Green, 3);
   PointF point1(100.0f, 100.0f);
   PointF point2(200.0f, 50.0f);
   PointF point3(400.0f, 10.0f);
   PointF point4(500.0f, 100.0f);   

   PointF curvePoints[4] = {
   point1,
   point2,
   point3,
   point4};

   PointF* pcurvePoints = curvePoints;

   // Draw the curve.
   graphics.DrawCurve(&greenPen, curvePoints, 4, 1.0);

   //Draw the points in the curve.
   SolidBrush redBrush(Color::Red);
   graphics.FillEllipse(&redBrush, Rect(95, 95, 10, 10));
   graphics.FillEllipse(&redBrush, Rect(195, 45, 10, 10));
   graphics.FillEllipse(&redBrush, Rect(395, 5, 10, 10));
   graphics.FillEllipse(&redBrush, Rect(495, 95, 10, 10));
}

要件

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

関連項目

カーディナル スプライン

DrawClosedCurve メソッド

カーディナル スプラインの描画

グラフィックス

ペン

Pointf