Share via


Graphics::D rawCurve (constPen*,constPoint*,INT,REAL) 方法 (gdiplusgraphics.h)

Graphics::D rawCurve 方法會繪製基數曲線。

語法

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

參數

[in] pen

類型: const Pen*

用來繪製基數曲線的手寫筆指標。

[in] points

類型: const Point*

Point 物件的陣列指標,指定基數曲線通過的座標。

[in] count

類型: INT

整數,指定 陣列中的項目數目。

[in] tension

類型: REAL

實數,指定曲線透過基數曲線座標的彎曲程度。

傳回值

類型: 狀態

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

如果方法失敗,它會傳回 Status 列舉的其中一個其他元素。

備註

線段定義為連接基數曲線中兩個連續點的曲線。 每個區段的結束點是下一個線段的起點。

範例

下列範例會繪製基數曲線。

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

   // Define a Pen object and an array of Point objects.
   Pen greenPen(Color::Green, 3);
   Point point1(100, 100);
   Point point2(200, 50);
   Point point3(400, 10);
   Point point4(500, 100);
   
   Point curvePoints[4] = {
   point1,
   point2,
   point3,
   point4};

   Point* 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)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

基本曲線

DrawClosedCurve 方法

繪製基數曲線

圖形