创建面注记PolygonElement
1.根据4点创建一个面
/// <summary>
/// 根据4个点创建图形,点序要顺时针
/// </summary>
/// <param name="pnt1">点1</param>
/// <param name="pnt2">点2</param>
/// <param name="pnt3">点3</param>
/// <param name="pnt4">点4</param>
/// <returns>IPolygon</returns>
public static IPolygon CreatePolygonBy4Points(IPoint pnt1, IPoint pnt2, IPoint pnt3, IPoint pnt4)
{
IPointCollection pPntCol = new PolygonClass();
object missing = Type.Missing; ////顺时针添加
pPntCol.AddPoint(pnt1, ref missing, ref missing);
pPntCol.AddPoint(pnt2, ref missing, ref missing);
pPntCol.AddPoint(pnt3, ref missing, ref missing);
pPntCol.AddPoint(pnt4, ref missing, ref missing);
pPntCol.AddPoint(pnt1, ref missing, ref missing); //// 为保持首尾相联,故将第一个点再添加一次
return pPntCol as IPolygon;
}
2.创建面符号
/// <summary>
/// 创建 面 符号
/// </summary>
/// <param name="r">The r.</param>
/// <param name="g">The g.</param>
/// <param name="b">The b.</param>
/// <returns>ISimpleFillSymbol</returns>
public static ISimpleFillSymbol CreateGeoSymbol(int r, int g, int b)
{
ISimpleFillSymbol psymbol = new SimpleFillSymbolClass() as ISimpleFillSymbol;
psymbol.Color = ColorCustom(r, g, b);
psymbol.Outline.Color = ColorCustom(r, g, b);
return psymbol;
}
3.创建PolygonElement
IElement pele = new PolygonElementClass();
pele.Geometry = pGeoCol as IGeometry;
(pele as IFillShapeElement).Symbol = CreateGeoSymbol(r, gD, b);
(pmap as IGraphicsContainer).AddElement(pele, 0);
创建面注记PolygonElement的更多相关文章
- 创建文本注记TextElement
1.创建一个字体 /// <summary> /// 字体设置 /// </summary> /// <param name="size">Th ...
- 创建线注记LineElement
1.根据2点创建一条线 /// <summary> /// 创建线 /// </summary> /// <param name="pnt1"> ...
- ArcGis 创建Annotation注记要素类、添加注记要素 并加载到Activeview AO C#
AO中一般有两种方式存储图面注记元素,一种使用TextElement,它是文档级的元素,编辑后要通过文档(mxd)保存:另一种是使用Annotation要素类,它是一个独立的要素类(featurecl ...
- 【ESRI论坛6周年征文】ArcEngine注记(Anno/ Label/Element等)处理专题 -入门篇
原发表于ESRI中国社区,转过来.我的社区帐号:jhlong http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=122097 ----------- ...
- ArcGIS中的标注和注记
在ArcMap中可以使用标注和注记来识别要素,选择标注或注记取决于你需要如何控制文本显示以及在ArcMap中如何存储文本. 1.标注只是临时显示相关数据或字段 2.标注用于长时间保存数据以及显示方式. ...
- AE指定字段转成注记
转自原文 ae指定字段转成注记 ArcMap中有一个功能是Label Features,就是可以将图层内指定字段值显示以Label形式显示在主窗口上,在Label Features后,用右键点击图层, ...
- 用IFeatureWorkspaceAnno.CreateAnnotationClass 创建注记图层时报“The application is not licensed to modify or create schema”的错误的解决方案。
用IFeatureWorkspaceAnno.CreateAnnotationClass 的方法创建注记图层的时候报"The application is not licensed to m ...
- 关于arcgis engine的注记显示与关闭问题
1.注记的添加需要拿到IGeoFeatureLayer接口下的AnnotationProperties属性,转为IAnnotationLayerPropertiesCollection接口,并创建一个 ...
- ArcEngine标注和注记
转自原文 ArcEngine标注和注记 标注和注记是ArcEngine中提供的两种使用文字信息标注地图要素的方式.其中标注是作为图层的属性存在的,可以动态创建,注记作为地理要素被存储.需要注意的是Sh ...
随机推荐
- 用python pickle库来存储数据对象
pickling有一个更常用的叫法是serialization,它是指把python对象转化成字节流byte stream, unpickling就是把byte stream转换成对象.python的 ...
- mybatis 动态sql表达式相关应用
一.mybatis 表达式简介 对于mybatis3 ,提供了一种动态sql的方式.通过动态sql我们可以直接在mybatis 的xm映射文件中直接通过条件判断的方式进行查询添加的拼接.mybatis ...
- C语言猜拳游戏
2016年最后一篇文章 今天闲来无事Google了一段C语言写的猜拳游戏的代码(本人水平比较低,几乎是刚入门),我没做什么修改.这个switch语句里面对result的处理让我眼前一新,原来是这么玩的 ...
- 【转载】4412开发板嵌入式QtE应用开发环境搭建
本文转自迅为iTOP-4412开发板实战教程书籍:http://topeetboard.com QtE应用需要使用开发工具qtcreator,本文介绍qtcreator-3.2.2的安装和使用.1. ...
- mysql5.7 root password change
mysqld_safe --skip-grant-tables &update mysql.user set authentication_string=password('Root_1234 ...
- [WPF系列-高级TemplateBinding vs RelativeSource TemplatedParent]
What is the difference between these 2 bindings: <ControlTemplate TargetType="{x:Type Button ...
- web项目log4j的配置模板
log4j.properties文件: log4j.rootLogger=DEBUG,Console,File //测试环境 为 debug, 生产时勿必改为info log4j.appender ...
- 游戏测评-桥梁建造系Poly Bridge破力桥?游戏测评
最近在b站看到了谜之声的视频:大家来造桥吧! 实在是太搞笑了,看到是一款新出不久还未正式发行的游戏,兴致一来便入手玩了玩.顺手也就写下了这篇测评. POLY BRIDGE 对这个游戏名怎么起个有趣的中 ...
- UVA - 11584 Partitioning by Palindromes[序列DP]
UVA - 11584 Partitioning by Palindromes We say a sequence of char- acters is a palindrome if it is t ...
- JS中的“!!”
var o={flag:true}; var test=!!o.flag;//等效于var test=o.flag||false; alert(test); 由于对null与undefined用! ...