Exemplo n.º 1
0
        private void updatePointToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IMultipoint multipoint;
            object      missing = Type.Missing;
            IPoint      point1  = new PointClass();

            point1.PutCoords(10, 10);
            IPoint point2 = new PointClass();

            point2.PutCoords(20, 20);
            IPointCollection pointCollection = new MultipointClass();

            pointCollection.AddPoint(point1, ref missing, ref missing);
            pointCollection.AddPoint(point2, ref missing, ref missing);
            point1 = new PointClass();
            point1.PutCoords(40, 10);
            pointCollection.UpdatePoint(1, point1);
            multipoint = pointCollection as IMultipoint;
            addFeature("multipoint", multipoint as IGeometry);
            System.Windows.Forms.MessageBox.Show("X = " + pointCollection.get_Point(1).X +
                                                 ", Y = " + pointCollection.get_Point(1).Y);
            this.axMapControl1.Extent = multipoint.Envelope;
            this.axMapControl1.Refresh();
        }