首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

添加标注 (地图xtreme2008&C#)

2012-09-09 
添加标注 (mapxtreme2008&C#)MapInfo.Data.Table activeMapTable MapInfo.Engine.Session.Current.Catal

添加标注 (mapxtreme2008&C#)
     MapInfo.Data.Table activeMapTable = MapInfo.Engine.Session.Current.Catalog.GetTable("layerName");
                          MapInfo.Mapping.LabelLayer lbLayer = new MapInfo.Mapping.LabelLayer("lbbLayer", "lbbLayer");
                         
                          MapInfo.Mapping.LabelSource lbSource = new MapInfo.Mapping.LabelSource(activeMapTable);
                          //set label\'s style
                          lbSource.DefaultLabelProperties.Style.Font.Name = "宋体";//字体
                          lbSource.DefaultLabelProperties.Style.Font.Size = 9;//大小
                          lbSource.DefaultLabelProperties.Layout.Alignment = MapInfo.Text.Alignment.CenterRight;//标注显示的位置
                          lbSource.DefaultLabelProperties.Layout.Offset = 7;//偏移量
                          lbSource.DefaultLabelProperties.Style.Font.ForeColor = System.Drawing.Color.Black;//标注字颜色 lbSource.DefaultLabelProperties.Style.Font.TextEffect=MapInfo.Styles.TextEffect.Box;//标注背景,Box为方框,Halo为光晕
                          lbSource.DefaultLabelProperties.Style.Font.BackColor = System.Drawing.Color.Yellow;//方框或者光晕的颜色
                          lbSource.DefaultLabelProperties.Style.Font.Shadow = false;//显示阴影
                          lbSource.DefaultLabelProperties.Caption = "xx";//标注字段
                          lbLayer.Sources.Append(lbSource);
                          biaoZhu = lbLayer.Alias;

                          MainMap.Map.Layers.Add(lbLayer);

热点排行