CGpGraphicsPath.GetPointCountmethod
Gets the number of points in this path's array of data points.
Syntax
FUNCTION GetPointCount () AS INT
Description
Gets the number of points in this path's array of data points. This is the same as the number of types in the path's array of point types.
Remarks
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.
Example
' ======================================================================================== ' The following example creates a path that has one ellipse and one line. The code calls ' the GraphicsPath.GetPointCount method to determine the number of data points stored in ' the path. Then the code calls the GraphicsPath::GetPathPoints method to retrieve those ' data points. Finally, the code fills a small ellipse at each of the data points. ' ======================================================================================== SUB Example_GetPointCount (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi
' // Create a path that has one ellipse and one line. DIM path AS CGpGraphicsPath path.AddEllipse(10, 10, 200, 100) path.AddLine(220, 120, 300, 160)
' // Find out how many data points are stored in the path. DIM nCount AS LONG = path.GetPointCount
' // Draw the path points DIM RedBrush AS CGpSolidBrush = ARGB_RED DIM points(nCount - 1) AS GpPointF path.GetPathPoints(@points(0), nCount)
FOR j AS LONG = 0 TO nCount - 1
graphics.FillEllipse(@redBrush, points(j).x - 3.0, points(j).y - 3.0, 6.0, 6.0)
NEXT
END SUB ' ========================================================================================
Reference
- Include file
CGpPath.inc - Defined in AfxNova/CGpPath.inc:543
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class