예제 #1
0
 internal MeasuringChangedEventArgs(_DMapEvents_MeasuringChangedEvent args)
 {
     _args = args;
     if (args == null)
     {
         throw new NullReferenceException("Internal reference is null.");
     }
 }
예제 #2
0
 private void AxMap1_MeasuringChanged(object sender, _DMapEvents_MeasuringChangedEvent e)
 {
     if (e.action == tkMeasuringAction.PointAdded)
     {
     }
     if (e.action == tkMeasuringAction.MesuringStopped)
     {
         if (btnAnotation.Checked)
         {
             Shape shp = new Shape();
             shp.Create(ShpfileType.SHP_POLYGON);
             //shp_tmp.EditAddShape()
             double x, y;
             //Debug.WriteLine("Measured points (in map units.): " + axMap1.Measuring.PointCount);
             for (int i = 0; i < axMap1.Measuring.PointCount; i++)
             {
                 if (axMap1.Measuring.get_PointXY(i, out x, out y))
                 {
                     //var c = 0;
                     MapWinGIS.Point ptn = new MapWinGIS.Point();
                     ptn.Set(x, y);
                     shp.InsertPoint(ptn, ref i);
                     //Debug.WriteLine("x={0}; y={1}", x, y);
                 }
             }
             tmpLayer.EditAddShape(shp);
             axMap1.Redraw();
         }
         if (btnVP.Checked)
         {
             double x, y;
             axMap1.Measuring.get_PointXY(0, out x, out y);
             MapWinGIS.Point pt1 = new Point();
             pt1.Set(x, y);
             axMap1.Measuring.get_PointXY(1, out x, out y);
             MapWinGIS.Point pt2 = new Point();
             pt2.Set(x, y);
             MapWinGIS.Image         DEMImg = axMap1.get_Image(idxLayerRaster);
             Vertical_Profiling_Form vpf    = new Vertical_Profiling_Form(DEMImg, pt1, pt2);
             vpf.Show(this);
             axMap1.Redraw();
         }
     }
 }
예제 #3
0
파일: Form1.cs 프로젝트: TheWind97/GIS
 private void mapControl_MeasuringChanged(object sender, _DMapEvents_MeasuringChangedEvent e)
 {
     if (e.action == tkMeasuringAction.MesuringStopped)
     {
         Shape shp = new Shape();
         shp.Create(ShpfileType.SHP_POLYGON);
         //shp_tmp.EditAddShape()
         double x, y;
         for (int i = 0; i < mapControl.Measuring.PointCount; i++)
         {
             if (mapControl.Measuring.get_PointXY(i, out x, out y))
             {
                 MapWinGIS.Point ptn = new MapWinGIS.Point();
                 ptn.Set(x, y);
                 shp.InsertPoint(ptn, ref i);
             }
         }
         Shapefile sfTmp = mapControl.get_Shapefile(currentLayerIndex);
         sfTmp.EditAddShape(shp);
         MessageBox.Show(sfTmp.NumShapes.ToString());
         mapControl.Redraw();
     }
 }
예제 #4
0
 private void MapMeasuringChanged(object sender, _DMapEvents_MeasuringChangedEvent e)
 {
     Invoke(sender, MeasuringChanged, new MeasuringChangedEventArgs(e));
 }