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
);
parameters
[in] pen
类型: const 触控笔*
指向用于绘制基数样条的笔的指针。
[in] points
类型: const PointF*
指向 PointF 对象数组的指针,这些对象指定基数样条通过的坐标。
[in] count
类型: INT
指定 点 数组中的元素数的整数。
[in] offset
类型: INT
整数,指定 点 数组中的元素,该元素指定基数样条线开始的点。
[in] numberOfSegments
类型: INT
指定基数样条中的段数的整数。
[in] tension
类型: REAL
实数,指定曲线在基线样条坐标上的弯曲程度。
返回值
类型: 状态
如果方法成功,则返回 Ok,这是 Status 枚举的元素。
如果 方法失败,它将返回 Status 枚举的其他元素之一。
注解
线段定义为连接基数样条中两个连续点的曲线。 每个段的终点是下一个段的起点。 numberOfSegments 参数不能大于 count 参数减去偏移参数加 1。
示例
以下示例绘制基数样条。
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) | 
| Library | Gdiplus.lib | 
| DLL | Gdiplus.dll |