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

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

構文

Status DrawClosedCurve(
  const Pen    *pen,
  const PointF *points,
  INT          count
);

パラメーター

pen

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

points

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

count

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

戻り値

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

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

解説

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

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

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

   // Define a Pen object and an array of PointF objects.
   Pen greenPen(Color(255, 0, 0, 255), 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 point5(600.0f, 200.0f);
   PointF point6(700.0f, 400.0f);
   PointF point7(500.0f, 500.0f);

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

必要条件

   
Header gdiplusgraphics.h

関連項目

カーディナル スプライン

DrawCurve メソッド

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

FillClosedCurve メソッド

グラフィックス

ペン

Pointf