Freigeben über


GraphicsPath.AddClosedCurve(const Point*, INT) method

Applies to: desktop apps only

The GraphicsPath::AddClosedCurve method adds a closed cardinal spline to this path.

Syntax

Status AddClosedCurve(
  [in]  const Point *points,
  [in]  INT count
);

Parameters

  • points [in]
    Type: const Point*

    Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through each point in the array.

  • count [in]
    Type: INT

    Integer that specifies the number of elements in the points array.

Return value

Type:

Type: Status****

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GraphicsPath::AddClosedCurve method; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

Examples

The following example creates a GraphicsPath object path, adds a closed cardinal spline to path, and then draws path.

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

   Point pts[] = {Point(50,50),
                  Point(60,20),
                  Point(70,100),
                  Point(80,50)};

   GraphicsPath path;
   path.AddClosedCurve(pts, 4);

   // Draw the path.
   Pen pen(Color(255, 255, 0, 0));
   graphics.DrawPath(&pen, &path);
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdipluspath.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

GraphicsPath

AddBezier Methods

AddBeziers Methods

AddClosedCurve Methods

AddCurve Methods

Point

Clipping with a Region

Constructing and Drawing Paths

Creating a Path Gradient

Drawing Cardinal Splines

Cardinal Splines

Paths

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012