GraphicsPath::Reverse method

The GraphicsPath::Reverse method reverses the order of the points that define this path's lines and curves.


Status Reverse(



This method has no parameters.

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.


A GraphicsPath object has an array of points and an array of types. Each element in the array of types is a byte that specifies the point type and a set of flags for the corresponding element in the array of points. Possible point types and flags are listed in the PathPointType enumeration.

This method reverses the order of the elements in the array of points and in the array of types.


The following example creates a GraphicsPath object path, adds two lines to path, calls the Reverse method, and then draws path.

VOID ReverseExample(HDC hdc)
   Graphics graphics(hdc);
   GraphicsPath path;

   // Set up and call Reverse.
   Point pts[] = {Point(10, 60),
                  Point(50, 110),
                  Point(90, 60)};
   path.AddLines(pts, 3);

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


Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdipluspath.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See Also

AddLines Methods

Clipping with a Region

Constructing and Drawing Paths

Creating a Path Gradient

GetPathPoints Methods