The Polyline dynamically allocates memory when vertices are added. However, if you know the number of vertices to be added, memory can be allocated to the exact size by specifying the number of vertices in the constructor. Specifying a non-zero value for vertices doesn't mean that the polyline automatically has that many vertices. It means that memory has been allocated, ready to be loaded with vertex information. The memory allocated is unused until it gets filled by Polyline.AddVertexAt() calls.
If a polyline is being grown or shrunk by adding or removing vertices, the dynamic memory allocation will only grow and not shrink. When the user is finished adding or removing vertices, there may be unused allocated memory. To trim this unused memory, use Polyline.MinimizeMemory() when all additions or removals to the polyline are done. This is not done automatically for every Polyline.AddVertexAt() and Polyline.RemoveVertexAt() because it is a time-expensive operation.
Public Sub New( vertices As Integer )
public Polyline( int vertices );
Parameters |
Description |
int vertices |
Input number of vertices to allocate memory for |
Comments? |