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

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

構文

Status DrawClosedCurve(
  [in] const Pen   *pen,
  [in] const Point *points,
  [in] INT         count
);

パラメーター

[in] pen

種類: const Pen*

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

[in] points

型: const Point*

閉じたカーディナル スプラインの座標を指定する Point オブジェクトの配列へのポインター。 Point オブジェクトの配列には、少なくとも 3 つの要素が含まれている必要があります。

[in] count

型: INT

ポイント配列内の要素の数を指定する整数。

戻り値

種類: 状態

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

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

解説

閉じたカーディナル スプラインでは、曲線は ポイント 配列の最後の点を通過し、配列の最初の点に接続します。

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


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

   // Define a Pen object and an array of Point objects.
   Pen greenPen(Color(255, 0, 0, 255), 3);

   Point point1(100, 100);
   Point point2(200, 50);
   Point point3(400, 10);
   Point point4(500, 100);
   Point point5(600, 200);
   Point point6(700, 400);
   Point point7(500, 500);

   Point curvePoints[7] = {
      point1,
      point2,
      point3,
      point4,
      point5,
      point6,
      point7};

   // Draw the closed curve.
   graphics.DrawClosedCurve(&greenPen, curvePoints, 7);

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

要件

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

関連項目

カーディナル スプライン

DrawCurve メソッド

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

FillClosedCurve メソッド

グラフィックス

ペン

Point