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

Graphics::D rawCurve 方法绘制基数样条。

语法

Status DrawCurve(
  const Pen    *pen,
  const PointF *points,
  INT          count
);

parameters

pen

指向用于绘制基数样条的笔的指针。

points

指向 PointF 对象数组的指针,该数组指定基数样条通过的坐标。

count

指定 数组中的元素数的整数。

返回值

如果该方法成功,则返回 Ok,这是 Status 枚举的元素。

如果方法失败,它将返回 Status 枚举的其他元素之一。

注解

段定义为连接基数样条中两个连续点的曲线。 每个段的终点是下一段的起点。

示例

以下示例绘制一条基数样条。

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

   // Define a Pen object and an array of Point 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;

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

   //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));
}

要求

   
标头 gdiplusgraphics.h

另请参阅

基数样条

DrawClosedCurve 方法

绘制基数样条

显卡

PointF