Skip to content

Latest commit

 

History

History
160 lines (102 loc) · 6.7 KB

nf-gdipluspath-graphicspathiterator-nextsubpath(constgraphicspath_bool).md

File metadata and controls

160 lines (102 loc) · 6.7 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist req.product ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:gdipluspath.GraphicsPathIterator.NextSubpath(constGraphicsPath,BOOL)
GraphicsPathIterator::NextSubpath(OUT const GraphicsPath,OUT BOOL) (gdipluspath.h)
The GraphicsPathIterator::NextSubpath method gets the next figure (subpath) from this iterator's associated path.
GraphicsPathIterator class [GDI+]
NextSubpath method
GraphicsPathIterator.NextSubpath
GraphicsPathIterator.NextSubpath(GraphicsPath*
BOOL*)
GraphicsPathIterator.NextSubpath(OUT const GraphicsPath
OUT BOOL)
GraphicsPathIterator::NextSubpath
GraphicsPathIterator::NextSubpath(OUT const GraphicsPath
OUT BOOL)
NextSubpath
NextSubpath method [GDI+]
NextSubpath method [GDI+]
GraphicsPathIterator class
_gdiplus_CLASS_GraphicsPathIterator_NextSubpath_path_isClosed_
gdiplus._gdiplus_CLASS_GraphicsPathIterator_NextSubpath_path_isClosed_
gdiplus\_gdiplus_CLASS_GraphicsPathIterator_NextSubpath_path_isClosed_.htm
gdiplus
VS|gdicpp|~\gdiplus\gdiplusreference\classes\graphicspathiteratorclass\graphicspathiteratormethods\graphicspathiteratornextsubpathmethods\nextsubpath.htm
12/05/2018
GraphicsPathIterator class [GDI+],NextSubpath method, GraphicsPathIterator.NextSubpath, GraphicsPathIterator.NextSubpath(GraphicsPath*,BOOL*), GraphicsPathIterator.NextSubpath(OUT const GraphicsPath,OUT BOOL), GraphicsPathIterator::NextSubpath, GraphicsPathIterator::NextSubpath(OUT const GraphicsPath,OUT BOOL), NextSubpath, NextSubpath method [GDI+], NextSubpath method [GDI+],GraphicsPathIterator class, _gdiplus_CLASS_GraphicsPathIterator_NextSubpath_path_isClosed_, gdiplus._gdiplus_CLASS_GraphicsPathIterator_NextSubpath_path_isClosed_
gdipluspath.h
Gdiplus.h
Windows
Windows XP, Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Gdiplus.lib
Gdiplus.dll
Windows
GDI+ 1.0
19H1
GraphicsPathIterator::NextSubpath
gdipluspath/GraphicsPathIterator::NextSubpath
c++
APIRef
kbSyntax
COM
Gdiplus.dll
GraphicsPathIterator.NextSubpath

GraphicsPathIterator::NextSubpath(OUT const GraphicsPath,OUT BOOL)

-description

The GraphicsPathIterator::NextSubpath method gets the next figure (subpath) from this iterator's associated path.

-parameters

-param path [out]

Type: GraphicsPath*

Pointer to a GraphicsPath object. This method sets the data points of this GraphicsPath object to match the data points of the retrieved figure.

-param isClosed [out]

Type: BOOL*

Pointer to a BOOL that receives a value that indicates whether the retrieved figure is closed. If the figure is closed, the received value is TRUE; otherwise, the received value is FALSE.

-returns

Type: INT

This method returns the number of data points in the retrieved figure. If there are no more figures to retrieve, this method returns 0.

-remarks

The first time you call the GraphicsPathIterator::NextSubpath method of an iterator, it gets the first figure (subpath) of that iterator's associated path. The second time, it gets the second figure, and so on. Each time you call GraphicsPathIterator::NextSubpath, it returns the number of data points in the retrieved figure. When there are no figures remaining, it returns 0.

Examples

The following example creates a GraphicsPath object and adds five figures (also called subpaths) to the path. The code passes the address of the GraphicsPath object to a GraphicsPathIterator constructor to create an iterator that is associated with the path. The code calls the iterator's GraphicsPathIterator::NextSubpath method twice to retrieve the second figure (subpath) from the path. Then the code calls the DrawPath method of a Graphics object to draw that individual subpath.

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

   // Create a graphics path with five figures (subpaths).
   GraphicsPath path;

   path.AddRectangle(Rect(20, 20, 60, 30));   // Subpath count is 1.

   path.AddLine(100, 20, 160, 50);            // Subpath count is 2.
   path.AddArc(180, 20, 60, 30, 0.0f, 180.0f);

   path.AddRectangle(Rect(260, 20, 60, 30));  // Subpath count is 3.

   path.AddLine(340, 20, 400, 50);            // Subpath count is 4.
   path.AddArc(340, 20, 60, 30, 0.0f, 180.0f);
   path.CloseFigure();
  
   path.AddRectangle(Rect(420, 20, 60, 30));  // Subpath count is 5.
 
   // Create an iterator, and associate it with the path.
   GraphicsPathIterator iterator(&path);

   // Get the second subpath by calling NextSubpath twice.
   GraphicsPath subpath;
   BOOL isClosed;
   INT count;
   count = iterator.NextSubpath(&subpath, &isClosed);
   count = iterator.NextSubpath(&subpath, &isClosed);

   // The variable "count" now holds the number of 
   // data points in the second subpath.

   // Draw the retrieved subpath.
   Pen bluePen(Color(255, 0, 0, 255));
   graphics.DrawPath(&bluePen, &subpath);
}

-see-also

Constructing and Drawing Paths

GetPathData

GraphicsPath

GraphicsPathIterator

GraphicsPathIterator::GetSubpathCount

GraphicsPathIterator::NextMarker Methods

NextSubpath

Paths