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的更多相关文章

  1. 创建文本注记TextElement

    1.创建一个字体 /// <summary> /// 字体设置 /// </summary> /// <param name="size">Th ...

  2. 创建线注记LineElement

    1.根据2点创建一条线 /// <summary> /// 创建线 /// </summary> /// <param name="pnt1"> ...

  3. ArcGis 创建Annotation注记要素类、添加注记要素 并加载到Activeview AO C#

    AO中一般有两种方式存储图面注记元素,一种使用TextElement,它是文档级的元素,编辑后要通过文档(mxd)保存:另一种是使用Annotation要素类,它是一个独立的要素类(featurecl ...

  4. 【ESRI论坛6周年征文】ArcEngine注记(Anno/ Label/Element等)处理专题 -入门篇

    原发表于ESRI中国社区,转过来.我的社区帐号:jhlong http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=122097 ----------- ...

  5. ArcGIS中的标注和注记

    在ArcMap中可以使用标注和注记来识别要素,选择标注或注记取决于你需要如何控制文本显示以及在ArcMap中如何存储文本. 1.标注只是临时显示相关数据或字段 2.标注用于长时间保存数据以及显示方式. ...

  6. AE指定字段转成注记

    转自原文 ae指定字段转成注记 ArcMap中有一个功能是Label Features,就是可以将图层内指定字段值显示以Label形式显示在主窗口上,在Label Features后,用右键点击图层, ...

  7. 用IFeatureWorkspaceAnno.CreateAnnotationClass 创建注记图层时报“The application is not licensed to modify or create schema”的错误的解决方案。

    用IFeatureWorkspaceAnno.CreateAnnotationClass 的方法创建注记图层的时候报"The application is not licensed to m ...

  8. 关于arcgis engine的注记显示与关闭问题

    1.注记的添加需要拿到IGeoFeatureLayer接口下的AnnotationProperties属性,转为IAnnotationLayerPropertiesCollection接口,并创建一个 ...

  9. ArcEngine标注和注记

    转自原文 ArcEngine标注和注记 标注和注记是ArcEngine中提供的两种使用文字信息标注地图要素的方式.其中标注是作为图层的属性存在的,可以动态创建,注记作为地理要素被存储.需要注意的是Sh ...

随机推荐

  1. weblogic忘记登陆密码

    以下内容来自网络: weblogic安装后,很久不用,忘记访问控制台的用户名或者密码,可通过以下步骤来重置用户名密码. 版本:WebLogic Server 11g 说明:%DOMAIN_HOME%: ...

  2. [原创]首次制作JQueryUI插件-Timeline时间轴

    特点: 1. 支持多左右滚动,左右拖动. 2. 时间轴可上下两种显示方式. 3. 支持两种模式的平滑滚动/拖动. 4. 行压缩(后续版本此处可设置是否开启,上传的代码不带这个功能). 5. 支持hov ...

  3. CentOS使用yum源中自带的rpm包安装LAMP环境

    CentOS使用yum源中自带的rpm包安装LAMP环境.这是Linux下安装LAMP的环境一种最基本最简便的方式.新手可以从容安装使用. 1. 安装基础包(可选安装)yum install -y w ...

  4. spark standalone ha spark submit

    when you build a spark standalone ha cluster, when you submit your app,  you should send it to the l ...

  5. php使用curl 检测socks5 代理的可用性

    少废话  直接粘代码 <?php    define('PROXY_CONF', 'ip:port');    define('PROXY_CHECK_URL', 'http://www.bai ...

  6. 374&375. Guess Number Higher or Lower 1&2

    做leetcode的题 We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You ...

  7. jdbc java数据库连接 1)jdbc入门

      之前操作数据 1)通过mysql的客户端工具,登录数据库服务器  (mysql -u root -p 密码) 2)编写sql语句 3)发送sql语句到数据库服务器执行 什么是jdbc? 使用jav ...

  8. WINDOW的cmd的命令【转载】

    转载地址:https://zhidao.baidu.com/question/583956458.htmlwinver---------检查windows版本 wmimgmt.msc----打开win ...

  9. mysql索引 (校验规则引发的血案)

    EXPLAIN SELECT a.* FROM gc_fin_rate_info  a LEFT JOIN rbac_user b ON a.owner =b.id; 处理之前的情况. 虽然走了索引, ...

  10. vs2010集成git指南

    1.安装 Git Extensions  下载地址:http://gotgit.github.com/gotgithub/10-appendix/030-install-on-windows-cygw ...