private void AddBut_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "Texture Files(*.bmp;*.jpg;*.png;*.tga;*.Spr;*.DDS)|*.bmp;*.jpg;*.png;*.tga;*.Spr;*.DDS"; if (dlg.ShowDialog() != DialogResult.OK) { return; } if (ExistFile(dlg.FileName)) { string message = string.Format("{0} 该文件已添加", dlg.FileName); MessageBox.Show(message); return; } RegionParam param = new RegionParam(); param.Path = dlg.FileName; RegionParamForm frm = new RegionParamForm(param, m_RegionParamDic); frm.ShowDialog(); m_RegionParamDic.Add(param.Name, param); ListViewItem item = new ListViewItem(param.Name); TargetListView.Items.Add(item); uint handle = 0; m_SceneEditor.SetFocus(); m_SceneEditor.AddRegionInfoManager(param.Path, param.PixelTolerance, param.SampleTimes, param.EliminateIsoDataCount, param.TotalValue, param.PixelCount, ref handle); param.Handle = handle; item.Selected = true; }
private void AddBut_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "Texture Files(*.bmp;*.jpg;*.png;*.tga;*.Spr;*.DDS)|*.bmp;*.jpg;*.png;*.tga;*.Spr;*.DDS"; if (dlg.ShowDialog() != DialogResult.OK) { return; } if (ExistFile(dlg.FileName)) { string message = string.Format("{0} 该文件已添加", dlg.FileName); MessageBox.Show(message); return; } RegionParam param = new RegionParam(); param.Path = dlg.FileName; RegionParamForm frm = new RegionParamForm(param, m_RegionParamDic); frm.ShowDialog(); m_RegionParamDic.Add(param.Name, param); ListViewItem item = new ListViewItem(param.Name); TargetListView.Items.Add(item); uint handle = 0; m_SceneEditor.SetFocus(); m_SceneEditor.AddRegionInfoManager(param.Path, param.PixelTolerance, param.SampleTimes, param.EliminateIsoDataCount, param.TotalValue, param.PixelCount, ref handle); param.Handle = handle; item.Selected = true; }