Beispiel #1
0
        //构造平行线上点法
        private void button8_Click(object sender, EventArgs e)
        {
            delFeature("point");
            IPoint[] points = new IPoint[2];
            for (int i = 0; i < 2; i++)
            {
                points[i] = new PointClass();
            }
            points[0].PutCoords(0, 0);
            points[1].PutCoords(20, 0);


            ISegment segment;
            ILine    line = new LineClass();

            line.FromPoint = points[0];
            line.ToPoint   = points[1];

            segment = line as ISegment;
            IPoint fromPoint = new PointClass();

            fromPoint.X = points[0].X + 10;
            fromPoint.Y = points[0].Y + 5;
            IConstructPoint constructPoint = new PointClass();

            constructPoint.ConstructParallel(segment, esriSegmentExtension.esriNoExtension, fromPoint, segment.Length);
            addFeature("point", points[0]);
            addFeature("point", points[1]);
            addFeature("point", constructPoint as IPoint);
            axMapControl1.Refresh();
        }