AE+C# 向axPageLayoutControl1添加图例
c# 添加 AE 图例
2023-09-14 09:02:23 时间
原文 AE+C# 向axPageLayoutControl1添加图例
//Get the GraphicsContainer IGraphicsContainer graphicsContainer = axPageLayoutControl1.GraphicsContainer; //Get the MapFrame IMapFrame mapFrame = (IMapFrame)graphicsContainer.FindFrame(axPageLayoutControl1.ActiveView.FocusMap); if (mapFrame == null) return; //Create a legend UID uID = new UIDClass(); uID.Value = "esriCarto.Legend"; //Create a MapSurroundFrame from the MapFrame IMapSurroundFrame mapSurroundFrame = mapFrame.CreateSurroundFrame(uID, null); if (mapSurroundFrame == null) return; if (mapSurroundFrame.MapSurround == null) return; //Set the name mapSurroundFrame.MapSurround.Name = "Legend"; //Envelope for the legend IEnvelope envelope = new EnvelopeClass(); envelope.PutCoords(1, 1, 3.4, 2.4); //Set the geometry of the MapSurroundFrame IElement element = (IElement)mapSurroundFrame; element.Geometry = envelope; //Add the legend to the PageLayout axPageLayoutControl1.AddElement(element, Type.Missing, Type.Missing, "Legend", 0); //Refresh the PageLayoutControl axPageLayoutControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
相关文章
- C#MQTTNET服务端使用说明
- 【说站】C#在PDF中添加墨迹注释Ink Annotation的步骤详解
- c#窗体添加背景音乐_eclipse怎么添加背景音乐
- c#设计登录界面并添加数据库_windows窗体连接数据库
- c#执行事务函数代码
- C#给站点指定位置的某种格式的图片添加水印
- .netc#gif动画如何添加图片水印实现思路及代码
- C#4.0大数的运算--BigInteger的应用详解
- C#实现协同过滤算法的实例代码
- C#日期时间格式化小结
- c#在excel中添加超链接示例分享
- c#使用filesystemwatcher实时监控文件目录的添加和删除
- c#反射表达式树模糊搜索示例
- c#程序删除自身代码示例分享
- 一则C#简洁瀑布流代码
- C#特性-对象集合初始化器介绍
- C#?肩被????寮??ㄧ被??涓???Equals??==???哄?????
- C#实现为类和函数代码自动添加版权注释信息的方法
- C#采用OpenXml给Word文档添加表格