public void RemoveUIModel(LegendModel m) { if (_uiLegendModels != null && _uiLegendModels.Contains(m)) { _uiLegendModels.Remove(m); } }
public void AddUIModel(LegendModel m) { if (_uiLegendModels == null) { _uiLegendModels = new List <LegendModel>(); } if (!_uiLegendModels.Contains(m)) { _uiLegendModels.Add(m); } }
private void LoadLegend() { LegendModel legendCharacters = new LegendModel(); legendCharacters.CarrierCharacter = CARRIER_CHAR; legendCharacters.BattleshipCharacter = BATTLESHIP_CHAR; legendCharacters.DestroyerCharacter = DESTROYER_CHAR; legendCharacters.SubmarineCharacter = SUBMARINE_CHAR; legendCharacters.SmallAssaultShipCharacter = ASSAULT_SHIP_CHAR; Legend = legendCharacters; }
private void btnDEM_Click(object sender, RoutedEventArgs e) { if (matImage != null && matImage.data != null) { imgMain.Tag = matImage; imgMain.Source = matImage.ToBitMap(curCorlor); curLengend = new LegendModel() { name = "DEM", lowValue = (int)matImage.minData, highVlaue = (int)matImage.maxData, colors = curCorlor }; legend.setValue(curLengend); } else { } }
private void btnSlope_Click(object sender, RoutedEventArgs e) { if (matImage != null && matImage.data != null) { var slopeCal = new SlopeCal(matImage); slopeMatImage = slopeCal.calSlope(); imgMain.Tag = slopeMatImage; imgMain.Source = slopeMatImage.ToBitMap(curCorlor); curLengend = new LegendModel() { name = "坡度", lowValue = (int)slopeMatImage.minData, highVlaue = (int)slopeMatImage.maxData, colors = curCorlor }; legend.setValue(curLengend); } else { MessageBox.Show("请先加载DEM数据"); } }
private void btnLoadFile_Click(object sender, RoutedEventArgs e) { System.Windows.Forms.OpenFileDialog oFileDialog = new System.Windows.Forms.OpenFileDialog(); oFileDialog.Filter = "文本文件(*.asc)|*.asc|所有文件(*.*)|*.*"; if (oFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { try { string filePath = oFileDialog.FileName; matImage = ReadASCFile.read(filePath); imgMain.Tag = matImage; imgMain.Source = matImage.ToBitMap(curCorlor); curLengend = new LegendModel() { name = "DEM", lowValue = (int)matImage.minData, highVlaue = (int)matImage.maxData, colors = curCorlor }; legend.setValue(curLengend); btnEnableInit(true); } catch (Exception ex) { } } }
public void Init(LegendModel model) { _model = model; _text.text = _model.Text; }