代码中有注释,直接上
指北针
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 IMarkerNorthArrow;
IMarkerSymbol markerSymbol = markerNorthArrow.MarkerSymbol;
markerSymbol.Size = 18;
markerNorthArrow.MarkerSymbol = markerSymbol;
//QI,确定mapSurroundFrame的位置
IElement element = mapSurroundFrame as IElement;
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords(0.2, 0.2, 5, 5);
element.Geometry = envelope;
//使用IGraphicsContainer接口添加显示
container.AddElement(element, 0);
activeView.Refresh();
}
比例尺
public void AddScalebar(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.AlternatingScaleBar";
IMapSurroundFrame mapSurroundFrame = mapFrame.CreateSurroundFrame(uid, null);
//设置MapSurroundFrame中比例尺的样式
IMapSurround mapSurround = mapSurroundFrame.MapSurround;
IScaleBar markerScaleBar = ((IScaleBar)mapSurround);
markerScaleBar.LabelPosition = esriVertPosEnum.esriBelow;
markerScaleBar.UseMapSettings();
//QI,确定mapSurroundFrame的位置
IElement element = mapSurroundFrame as IElement;
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords(0.2, 0.2, 1, 2);
element.Geometry = envelope;
//使用IGraphicsContainer接口添加显示
container.AddElement(element, 0);
activeView.Refresh();
}
图例
private void AddLegend(IPageLayout pageLayout)
{
IActiveView pActiveView = pageLayout as IActiveView;
IGraphicsContainer container = pageLayout as IGraphicsContainer;
// 获得MapFrame
IMapFrame mapFrame = container.FindFrame(pActiveView.FocusMap) as IMapFrame;
//根据MapSurround的uid,创建相应的MapSurroundFrame和MapSurround
UID uid = new UIDClass();
uid.Value = "esriCarto.Legend";
IMapSurroundFrame mapSurroundFrame = mapFrame.CreateSurroundFrame(uid, null);
//设置图例的Title
ILegend2 legend = mapSurroundFrame.MapSurround as ILegend2;
legend.Title = "地图图例";
ILegendFormat format = new LegendFormatClass();
ITextSymbol symbol = new TextSymbolClass();
symbol.Size = 4;
format.TitleSymbol = symbol;
legend.Format = format;
//QI,确定mapSurroundFrame的位置
IElement element = mapSurroundFrame as IElement;
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords(2, 2, 8, 8);
element.Geometry = envelope;
//使用IGraphicsContainer接口添加显示
container.AddElement(element, 0);
pActiveView.Refresh();
}
分享到:
相关推荐
C#开发ArcGIS Engine中在PageLayout插入指北针、图例、比例尺等
关于 ArcGIS 二次开发--出图工具:添加图名、比例尺、指北针、图例,导出图片或文件、打印地图 做的小Demo
比较齐全的专题图制作的源代码,主要包括指北针,比例尺,图例,以及输出为图片的源代码
(1) 常用功能 测量 (2) 空间分析 ...(7) 出版制图(打印输出,添加文本,添加图例、比例尺、指北针) (8) 失栅转换(栅格转矢量、矢量转栅格) (9) 右键菜单 (10) 鹰眼 (11) 符号渲染
AE地图要素的插入汇总 在地图出图中经常需要插入一些地图装饰,如文字、指北针、比例尺、图例等等。下面分别给出具体实现,包括各种符号的设置。
地图旁注包括图例、标题、格网和经纬网、比例尺、比例文本、指北针以及空间参考信息等项,还包括其他图形和文本项。
6主要包含的功能设计了地图文件打开添加,给地图添加指北针、图例、比例尺;三种不同类型的地图格网的添加;设置设置制图模板;地图打印和输出等
地图旁注包括图例、标题、格网和经纬网、比例尺、比例文本、指北针以及空间参考信息等项,还包括其他图形和文本项。
将图例,指北针等布局元素添加到CAD数据集中,再添加图名,比例尺等文字信息,直接将带以上要素的地图输出成PNG图片。
(1)基于python与PyQis自动生成专题图,包括图例,图名,比例尺、指北针、有经纬度线的外图框等地理要素等信息。 (2)包含一份样例数据sample_data,包括一个多光谱遥感影像以及一个农分类分类的结果矢量。 (3)...
ArcGIS_Engine_C#实例开发教程,主要介绍了如何使用AE进行地图制图的开发,如添加指北针,图例,比例尺等。
环境:VS2005+ArcEngine9.2 实现图例、指北针、比例尺、边框、符号的设置
②“工具”菜单(指北针图例比例尺) ③“文件”菜单(打开保存另存为导出) ④“着色”菜单(简单统一唯一值) ⑤“空间分析”菜单(缓冲区叠合分析) ⑥“编辑”菜单(交互式添加点线面) ⑦“鹰眼”功能
但是由于涉及到专业及版权问题,本次上传代码事实上是一个阉割版的系统,只包括图像处理功能,包括地图文件的加载和删除、地图输出为PDF、JPG、PNG等格式、地图要素的插入和删除(包括指北针、比例尺、图例)、栅格...
1. 读取文本文件中的坐标点数据及利用相关投影变换公式转换直角坐标,并采用合适的画笔和画刷工具绘制成图。 2. 根据汇总表中植物的主要分布县(区)...需要包含专题地图的基本要素,如标题、比例尺、图例、指北针等。
基于ArcGIS Engine和VS2012的空间分析程序系统 主要功能包括:计算坡向 重分类 欧氏距离 插值分析 栅格计算器 指北针 比例尺 图例等。
ArcGIS中页面布局(通常简称为布局)是在虚拟...常见的地图元素包括一个或多个数据框(每个数据框都含有一组有序的地图图层)、比例尺、指北针、地图标题、描述性文本和图例。为提供地理参考,还可以添加格网或经纬网。
1、先要设置图幅修饰 2、视图窗口左下方有个“layout view”,点一下,就可以设置图幅了,新手可以在layout菜单下选择现有的图幅样式,包括了比例尺、指北针、图例等 3、设置好了以后,就可以选择打印出图了
ArcGIS中页面布局(通常称为布局)是在虚拟页面上组织的地图元素的集合,...布局中排布的常见地图元素包括一个或多个数据框(每个数据框都含有一组有序的地图图层)、比例尺、指北针、地图标题、描述性文本和符号图例。
ArcMap 是 ArcGIS 中使用的主要应用程序,可用于执行各种常见的 GIS 任务以及专业性的用户特定的任务。...常见的地图元素包括含有给定范围的地图图层的数据框,以及比例尺、指北针、标题、描述性文本和符号图例等等。