Ejemplo n.º 1
0
        /// <param name="argument">间隔数值类型,密度分割文件,选择波段,最小值,间隔值
        ///                        间隔数值类型:1:int 2:float,默认:int</param>
        public override void Execute()
        {
            ICanvasViewer viewer = _smartSession.SmartWindowManager.ActiveCanvasViewer;

            if (viewer == null)
            {
                return;
            }
            _drawing = viewer.ActiveObject as IRasterDrawing;
            IProgressMonitor progress = _smartSession.ProgressMonitorManager.DefaultProgressMonitor;

            using (DensitySliceForm frm = new DensitySliceForm(_drawing))
            {
                frm.UpdateDensSliceEvent += new DensitySliceForm.UpdateDensSlice(frm_UpdateDensSliceEvent);
                frm.Progress              = progress;
                SetFormStatus(frm);
                if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    _drawing.SelectedBandNos = new int[] { frm.SelectBand };
                    _drawing.ApplyColorMapTable(frm.ColorTable);
                    ICanvasViewer cv = _smartSession.SmartWindowManager.ActiveCanvasViewer;
                    if (cv != null)
                    {
                        cv.Canvas.Refresh(Core.DrawEngine.enumRefreshType.All);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void InitFrmByArugment(DensitySliceForm frm, string argument)
 {
     string[] split = argument.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
     if (split.Length < 4)
     {
         return;
     }
     frm.InitByArugment(split[0], int.Parse(split[1]), float.Parse(split[2]), float.Parse(split[3]));
 }
Ejemplo n.º 3
0
 private void SetFormStatus(DensitySliceForm frm)
 {
     frm.Owner         = _smartSession.SmartWindowManager.MainForm as Form;
     frm.StartPosition = FormStartPosition.Manual;
     frm.Location      = _smartSession.SmartWindowManager.ViewLeftUpperCorner;
 }