コード例 #1
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            SegClassForm segClassForm = new SegClassForm();

            segClassForm.ShowDialog();
            if (RuleSetMessage.OutShpPath != null || RuleSetMessage.OutClassResultsPath != null)
            {
                if (RuleSetMessage.OutShpPath != null)
                {
                    ILayer layer = LayerFactory.CreateDefaultLayer(RuleSetMessage.OutShpPath);
                    if (layer != null)
                    {
                        axMapControl2.FocusMap.AddLayer(layer);
                        axMapControl2.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
                        RuleSetMessage.OutShpPath = null;
                    }
                }
                else
                {
                    ILayer layer = LayerFactory.CreateDefaultLayer(RuleSetMessage.OutClassResultsPath);
                    if (layer != null)
                    {
                        axMapControl2.FocusMap.AddLayer(layer);
                        axMapControl2.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
                        RuleSetMessage.OutClassResultsPath = null;
                    }
                }
            }
        }
コード例 #2
0
 public override void OnClick()
 {
     if (RuleSetMessage.imagePath != null)
     {
         ILayer layer = LayerFactory.CreateDefaultLayer(RuleSetMessage.imagePath);
     }
 }
コード例 #3
0
        private void OnAlgoExecuteCompleted(ISystemAlgo algo)
        {
            ILayer layer = LayerFactory.CreateDefaultLayer(ISODATA_FRM.ISODataParams.OutputFilePath);

            m_HookHelper.FocusMap.AddLayer(layer);
            m_HookHelper.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
            ISystemAlgoEvents algoEvents = algo as ISystemAlgoEvents;

            algoEvents.OnExecuteCompleted          -= OnAlgoExecuteCompleted;
            algoEvents.OnProgressChanged           -= OnAlgoProgresChanged;
            MainForm.parentForm.myProgressBar.Value = 0;
            MainForm.parentForm.myLabel.Text        = "";
        }
コード例 #4
0
        private void OnAlgoExecuteCompleted(ISystemAlgo algo)
        {
            //ISODataClassification_Exchange_Info exchange_Info = new ISODataClassification_Exchange_Info();
            //IRasterDataset rasterDataset = DatasetFactory.OpenRasterDataset(exchange_Info.OutputFilePath, OpenMode.ReadOnly) as IRasterDataset;
            //ILayer layer = LayerFactory.CreateDefaultRasterLayer(rasterDataset) as ILayer;
            ILayer layer = LayerFactory.CreateDefaultLayer(MyIODATA_FRM.ISODataParams.OutputFilePath);

            //IMap map = m_HookHelper.FocusMap;
            // map.AddLayer(layer);
            m_HookHelper.FocusMap.AddLayer(layer);
            m_HookHelper.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
            ISystemAlgoEvents algoEvents = algo as ISystemAlgoEvents;

            algoEvents.OnExecuteCompleted -= OnAlgoExecuteCompleted;
            //algoEvents.OnProgressChanged -= OnAlgoProgresChanged;
        }
コード例 #5
0
 private void bn_LoadImage_Click(object sender, EventArgs e)
 {
     openFileDialog1.Title            = "加载影像";
     openFileDialog1.Filter           = "栅格数据|*.tif;*.tiff;*.img";
     openFileDialog1.RestoreDirectory = true;
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         tb_image.Text            = openFileDialog1.FileName;
         RuleSetMessage.imagePath = openFileDialog1.FileName;
         if (RuleSetMessage.imagePath != null)
         {
             ILayer layer = LayerFactory.CreateDefaultLayer(RuleSetMessage.imagePath);
             MainForm.parentForm.axMapControl2.FocusMap.AddLayer(layer);
             MainForm.parentForm.axMapControl2.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
         }
     }
 }