private void button_submit_Click(object sender, RoutedEventArgs e) { if (this.IMSCatalog.ActiveLayerObj == null) { MessageBox.Show("当前没有激活的地图图层,请激活!", "提示", MessageBoxButton.OK); return; } CSetLayerDisplayStyle style = new CSetLayerDisplayStyle(); style.DisplayStyle = new CDisplayStyle[this.IMSCatalog.ActiveLayerObj.LayerObj.LayerAccessInfo.Length]; for (int i = 0; i < this.IMSCatalog.ActiveLayerObj.LayerObj.LayerAccessInfo.Length; i++) { style.DisplayStyle[i] = new CDisplayStyle(); style.DisplayStyle[i].DriverQuality = this.radioButton_img_high.IsChecked.Value ? 2 : 0; //style.DisplayStyle[i].FollowScale = this.checkBox_followshow.IsChecked.Value; style.DisplayStyle[i].AnnSizeFixed = !this.checkBox_followshow.IsChecked.Value; style.DisplayStyle[i].LinPenWidFixed = !this.checkBox_followshow.IsChecked.Value; style.DisplayStyle[i].LinSizeFixed = !this.checkBox_followshow.IsChecked.Value; style.DisplayStyle[i].PntPenWidFixed = !this.checkBox_followshow.IsChecked.Value; style.DisplayStyle[i].PntSizeFixed = !this.checkBox_followshow.IsChecked.Value; style.DisplayStyle[i].RegPenWidFixed = !this.checkBox_followshow.IsChecked.Value; style.DisplayStyle[i].RegSizeFixed = !this.checkBox_followshow.IsChecked.Value; style.DisplayStyle[i].ShowCoordPnt = this.checkBox_showcoor.IsChecked.Value; style.DisplayStyle[i].SymbleShow = this.checkBox_origin.IsChecked.Value; } try { this.IMSCatalog.ActiveLayerObj.SetLayerDisplayStyle(style, OnSetStyle); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void river_Loaded(object sender, RoutedEventArgs e) { //初始化动态注记类对象 dynNoteInfo = new CDynNoteInfo(); //设置显示动态注记的字段名 dynNoteInfo.FieldName = "NAME"; //设置显示动态注记的字体大小 dynNoteInfo.FontSize = 12; //初始化地图显示参数对象 dynStyle = new DynShowStyle(); //设置显示动态注记 dynStyle.DynNoteFlag = true; //设置动态注记参数 dynStyle.DynNoteInfo = dynNoteInfo; //初始化地图显示样式类对象 displayStyle = new CDisplayStyle(); displayStyle.ShowStyle = new DynShowStyle[1]; //设置第一个图层的地图显示样式 displayStyle.ShowStyle[0] = dynStyle; //初始化设置图像显示参数 setDisplayStyle = new CSetLayerDisplayStyle(); setDisplayStyle.DisplayStyle = new CDisplayStyle[1]; //设置需要的显示参数 setDisplayStyle.DisplayStyle[0] = displayStyle; this.tilelayer.IsChecked = true; }