Export (0) Print
Expand All
Expand Minimize

Graphics.FillPath method

Applies to: desktop apps only

The Graphics::FillPath method uses a brush to fill the interior of a path. If a figure in the path is not closed, this method treats the nonclosed figure as if it were closed by a straight line that connects the figure's starting and ending points.

Syntax

Status FillPath(
  [in]  const Brush *brush,
  [in]  const GraphicsPath *path
);

Parameters

brush [in]

Type: const Brush*

Pointer to a Brush object that is used to paint the interior of the path.

path [in]

Type: const GraphicsPath*

Pointer to a GraphicsPath object that specifies 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 fills a path.


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

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

   // Create a SolidBrush object.
   SolidBrush blackBrush(Color(255, 0, 0, 0));

   // Draw ellipsePath.
   graphics.FillPath(&blackBrush, &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
GraphicsPath
Constructing and Drawing Paths
Paths

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2014 Microsoft