代码中有注释,直接上
指北针
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;
IMarkerN