窗体设计:
代码:
private void button_src_Click(object sender, EventArgs e)
{
OpenFileDialog openFile = new OpenFileDialog();
openFile.Title = "请选择待校正影像";
openFile.Multiselect = false;
if (openFile.ShowDialog() != DialogResult.OK) return;
if (m_SrcLayer != null) mapControl_src.FocusMap.DeleteLayer(m_SrcLayer);
m_SrcLayer = LayerFactory.CreateDefaultLayer(openFile.FileName);
if (m_SrcLayer == null) return;
//添加图层
mapControl_src.FocusMap.AddLayer(m_SrcLayer);
mapControl_src.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
textBox_srcImg.Text = openFile.FileName;
}
private void button_dst_Click(object sender, EventArgs e)
{
SaveFileDialog saveFile = new SaveFileDialog();
saveFile.Filter = "栅格影像|*.tiff;*.tif";
if (saveFile.ShowDialog() != DialogResult.OK) return;
textBox_dst.Text = saveFile.FileName;
}
private void button_run_Click(object sender, EventArgs e)
{
//string inFile = textBox_srcImg.Text;
//string outFile = textBox_dst.Text;
///
///大气校正算法测试,本算法实现了将GF1_PMS1_E116.5_N39.4_20131127_L1A0000117600-MSS1.tiff进行大气校正
///大气模式为系统自动选择大气模式,气溶胶类型为大陆性气溶胶,初始能见度为40km,逐项元反演气溶胶为是
///
#region 1、参数设置