Graphics::D rawCurve 方法绘制基数样条。
语法
Status DrawCurve(
  [in] const Pen   *pen,
  [in] const Point *points,
  [in] INT         count,
  [in] REAL        tension
);
参数
[in] pen
类型: const 触控笔*
指向用于绘制基数样条的笔的指针。
[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) | 
| Library | Gdiplus.lib | 
| DLL | Gdiplus.dll |