Share via


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物件的陣列至少必須包含三個專案。

count

指定 陣列中專案數的整數。

傳回值

如果方法成功,它會傳回 Ok,這是 Status 列舉的元素。

如果方法失敗,它會傳回 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));
}

需求

   
標頭 gdiplusgraphics.h

另請參閱

基本曲線

DrawCurve 方法

繪製基數曲線

FillClosedCurve 方法

圖形

PointF