This document is archived and information here might be outdated. Recommended version. |
Adds copies of the input points as vertices to this Path, Ring, Polyline, or Polygon; or references to the input points to this Multipoint, Triangles, TriangleFan, or TriangleStrip.
[Visual Basic .NET] Public Sub AddPoints ( _ ByVal pPointCollection As IPointCollection4, _ ByRef newPoints As IPoint[] _ )
[C#] public void AddPoints ( IPointCollection4 pPointCollection, ref IPoint[] newPoints );
[C++]
HRESULT AddPoints(
IPointCollection4* pPointCollection,
SAFEARRAY(IPoint)** newPoints
);
[C++] Parameters pPointCollection [in]
pPointCollection is a parameter of type IPointCollection4* newPoints [in]
newPoints is a parameter of type SAFEARRAY(IPoint*)*
All development languages compatible version of IPointCollection::AddPoints .
public void AddPoints()
{
IPoint point1 = new PointClass();
point1.PutCoords(10, 10);
IPoint point2 = new PointClass();
point2.PutCoords(20, 20);
IPoint[] pointArray = new IPoint[2];
pointArray[0] = point1;
pointArray[1] = point2;
IPointCollection4 pointCollection = new PolylineClass();
//add points to pointCollection
IGeometryBridge geometryBridge = new GeometryEnvironmentClass();
geometryBridge.AddPoints(pointCollection, ref pointArray);
System.Windows.Forms.MessageBox.Show(pointCollection.PointCount + " points added to PointCollection");
}