请教:如何用C#+Arcgis Engine 实现指北针和图例?

来源:百度知道 编辑:UC知道 时间:2024/05/09 06:28:31
如题!最好 能给出代码!谢谢

m_pageLayoutControl.CurrentTool = null;
IGraphicsContainer graphicsContainer = axPageLayoutControl1.GraphicsContainer;
IMapFrame mapFrame = (IMapFrame)graphicsContainer.FindFrame(axPageLayoutControl1.ActiveView.FocusMap);
if (mapFrame == null)
return;
UID uID = new UIDClass();
uID.Value = "esriCarto.Legend";
IMapSurroundFrame mapSurroundFrame = mapFrame.CreateSurroundFrame(uID, null);
if (mapSurroundFrame == null) return;
if (mapSurroundFrame.MapSurround == null) return;
mapSurroundFrame.MapSurround.Name = "图例";
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords(1, 1, 3.4, 2.4);
IElement element = (IElement)mapSurroundFrame;
element.Geometry = envelope;
axPageLayoutControl1.AddElement(element, Type.