Пример #1
0
 private void FillBandNos(string filename)
 {
     if (Path.GetExtension(filename) == ".000")
     {
         MicapsDataProcess mp           = new MicapsDataProcess();
         string[]          displayNames = mp.DisplayNames;
         long []           indexs       = MicapsDataProcess.Index(displayNames);
         int ct = displayNames.Length;
         if (ct != 0)
         {
             foreach (string name in displayNames)
             {
                 ListViewItem it = new ListViewItem(name);
                 it.Tag = MicapsDataProcess.Index(name);
                 lvBands.Items.Add(it);
             }
         }
     }
     else
     {
         using (IRasterDataProvider dataPrd = GeoDataDriver.Open(filename) as IRasterDataProvider)
         {
             if (dataPrd.BandCount > 0)
             {
                 int bandCount = dataPrd.BandCount;
                 for (int i = 1; i <= bandCount; i++)
                 {
                     ListViewItem it = new ListViewItem("Band " + i.ToString());
                     it.Tag = i;
                     lvBands.Items.Add(it);
                 }
             }
         }
     }
 }
Пример #2
0
 private int GetBandNo(ComboBox combox, bool isMicaps = false)
 {
     if (isMicaps)
     {
         return(MicapsDataProcess.Index(combox.SelectedItem.ToString()));
     }
     else
     {
         return(combox.SelectedIndex + 1);
     }
 }
Пример #3
0
        private int GetBandNo(ComboBox combox)
        {
            string name = combox.SelectedItem.ToString();

            if (!name.Contains("band"))
            {
                return(MicapsDataProcess.Index(name));
            }
            else
            {
                return(combox.SelectedIndex + 1);
            }
        }
Пример #4
0
 private void AddFileToListBox(string[] filename, ListBox listbox, ComboBox comboBox)
 {
     listbox.Items.Clear();
     for (int i = 0; i < filename.Length; i++)
     {
         listbox.Items.Add(filename[i]);
     }
     comboBox.Items.Clear();
     if (listbox.Items.Count > 0)
     {
         if (Path.GetExtension(filename[0]) == ".000")
         {
             MicapsDataProcess mp           = new MicapsDataProcess();
             string[]          displayNames = mp.DisplayNames;
             int ct = displayNames.Length;
             if (ct != 0)
             {
                 foreach (string name in displayNames)
                 {
                     comboBox.Items.Add(name);
                 }
                 comboBox.SelectedIndex = 0;
             }
         }
         else
         {
             using (IRasterDataProvider dataPrd = GeoDataDriver.Open(filename[0]) as IRasterDataProvider)
             {
                 if (dataPrd.BandCount > 0)
                 {
                     int bandCount = dataPrd.BandCount;
                     for (int i = 1; i <= bandCount; i++)
                     {
                         comboBox.Items.Add("band" + i);
                     }
                     comboBox.SelectedIndex = 0;
                 }
             }
         }
     }
 }