Share via


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

[in] count

類型: INT

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

傳回值

類型: 狀態

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

如果方法失敗,它會傳回 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)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

基本曲線

DrawCurve 方法

繪製基數曲線

FillClosedCurve 方法

圖形