Closes an open figure in a path.

BOOL CloseFigure( );

Nonzero if the function is successful; otherwise 0.

The function closes the figure by drawing a line from the current position to the first point of the figure (usually, the point specified by the most recent call to the MoveTo member function) and connects the lines by using the line join style. If a figure is closed by using the LineTo member function instead of CloseFigure, end caps are used to create the corner instead of a join. CloseFigure should only be called if there is an open path bracket in the device context.

A figure in a path is open unless it is explicitly closed by using this function. (A figure can be open even if the current point and the starting point of the figure are the same.) Any line or curve added to the path after CloseFigure starts a new figure.

Header: afxwin.h

Community Additions