Graphics.DrawPath method

Applies to: desktop apps only

The Graphics::DrawPath method draws a sequence of lines and curves defined by a GraphicsPath object.

Syntax

Status DrawPath(
  [in]  const Pen *pen,
  [in]  const GraphicsPath *path
);

Parameters

pen [in]

Type: const Pen*

Pointer to a pen that is used to draw the path.

path [in]

Type: const GraphicsPath*

Pointer to a GraphicsPath object that specifies the sequence of lines and curves that make up the path.

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.

Examples

The following example draws a GraphicsPath object.


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

   // Create a GraphicsPath, and add an ellipse.
   GraphicsPath ellipsePath;
   ellipsePath.AddEllipse(Rect(0, 0, 200, 100));

   // Create a Pen object.
   Pen blackPen(Color(255, 0, 0, 0), 3);

   // Draw ellipsePath.
   graphics.DrawPath(&blackPen, &ellipsePath);
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics
FillPie Methods
GraphicsPath
Creating Figures from Lines, Curves, and Shapes
Paths

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show: