- public void AddNorthArrow(IPageLayout pageLayout)
- {
- IGraphicsContainer container = pageLayout as IGraphicsContainer;
- IActiveView activeView = pageLayout as IActiveView;
- // 获得MapFrame
- IFrameElement frameElement = container.FindFrame(activeView.FocusMap);
- IMapFrame mapFrame = frameElement as IMapFrame;
- //根据MapSurround的uid,创建相应的MapSurroundFrame和MapSurround
- UID uid = new UIDClass();
- uid.Value = "esriCarto.MarkerNorthArrow";
- IMapSurroundFrame mapSurroundFrame = mapFrame.CreateSurroundFrame(uid, null);
- //设置MapSurroundFrame中指北针的点符号
- IMapSurround mapSurround = mapSurroundFrame.MapSurround;
- IMarkerNorthArrow markerNorthArrow = mapSurround as IMarker
添加图例、比例尺、指北针(转载)
最新推荐文章于 2024-06-22 13:51:06 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)