Share via


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

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

語法

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

參數

[in] pen

類型:const Pen*

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

[in] points

類型:const PointF*

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

[in] count

類型: INT

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

[in] offset

類型: INT

整數,指定 陣列中的專案,指定基數曲線開始的點。

[in] numberOfSegments

類型: INT

整數,指定基數曲線中的線段數目。

[in] tension

類型: REAL

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

傳回值

類型: 狀態

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

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

備註

線段定義為連接基數曲線中兩個連續點的曲線。 每個區段的結束點是下一個線段的起點。 numberOfSegments參數不能大於count參數減去位移參數加上一個。

範例

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

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

   // Define a Pen object and an array of PointF objects.
   Pen greenPen(Color::Green, 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 curvePoints[4] = {
   point1,
   point2,
   point3,
   point4};

   PointF* pcurvePoints = curvePoints;

   // Specify offset, number of segments to draw, and tension.
   int offset = 1;
   int segments = 2;
   REAL tension = 1.0f;

   // Draw the curve.
   graphics.DrawCurve(&greenPen, curvePoints, 4, offset, segments, tension);

   //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 方法

繪製基數曲線

圖形