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.GetCount |
GraphicsPathIterator::GetCount (gdipluspath.h) |
The GraphicsPathIterator::GetCount method returns the number of data points in the path. |
|
gdiplus\_gdiplus_CLASS_GraphicsPathIterator_GetCount_.htm |
gdiplus |
VS|gdicpp|~\gdiplus\gdiplusreference\classes\graphicspathiteratorclass\graphicspathiteratormethods\getcount.htm |
12/05/2018 |
GetCount, GetCount method [GDI+], GetCount method [GDI+],GraphicsPathIterator class, GraphicsPathIterator class [GDI+],GetCount method, GraphicsPathIterator.GetCount, GraphicsPathIterator::GetCount, _gdiplus_CLASS_GraphicsPathIterator_GetCount_, gdiplus._gdiplus_CLASS_GraphicsPathIterator_GetCount_ |
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 |
|
|
|
|
|
|
The GraphicsPathIterator::GetCount method returns the number of data points in the path.
Type: INT
This method returns the number of data points in the path.
This GraphicsPathIterator object is associated with a GraphicsPath object. That 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.
The following example creates a GraphicsPath object and then adds a rectangle and an ellipse to the path. The code passes the address of that GraphicsPath object to a GraphicsPathIterator constructor to create an iterator that is associated with the path. The code calls the iterator's GraphicsPathIterator::GetCount method to determine the number of data points in the path. The call to GraphicsPathIterator::Enumerate retrieves two arrays from the path: one that holds the path's data points and one that holds the path's point types. After the data points have been retrieved, the code calls the FillEllipse method of a object to draw each of the data points.
VOID GetCountExample(HDC hdc)
{
Graphics graphics(hdc);
// Create a path that has a rectangle and an ellipse.
GraphicsPath path;
path.AddRectangle(Rect(20, 20, 60, 30));
path.AddEllipse(Rect(20, 70, 100, 50));
// Create an iterator, and associate it with the path.
GraphicsPathIterator iterator(&path);
// Get the number of data points in the path.
INT count = iterator.GetCount();
// Get the data points.
PointF* points = new PointF[count];
BYTE* types = new BYTE[count];
iterator.Enumerate(points, types, count);
// Draw the data points.
SolidBrush brush(Color(255, 255, 0, 0));
for(INT j = 0; j < count; ++j)
graphics.FillEllipse(
&brush,
points[j].X - 3.0f,
points[j].Y - 3.0f,
6.0f,
6.0f);
delete points;
delete types;
}
Constructing and Drawing Paths
GraphicsPathIterator::CopyData