博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ArcGIS Engine中添加点、线、面元素
阅读量:4351 次
发布时间:2019-06-07

本文共 1097 字,大约阅读时间需要 3 分钟。

转自原文

此种方式为IElement的方式在axMapControlGraphicsContainer中好绘制图形。

 

//画点
IPoint pt = axMapControl1.ToMapPoint(e.x, e.y);
IMarkerElement pMarkerElement = new MarkerElementClass();
IElement pElement = pMarkerElement as IElement;
pElement.Geometry = pt;
IGraphicsContainer pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)pMarkerElement, 0);
pActiveView.Refresh();
//画线
IGeometry polyline = axMapControl1.TrackLine();
ILineElement pLineElement = new LineElementClass();
IElement pElement = pLineElement as IElement;
pElement.Geometry = polyline;
IGraphicsContainer pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)pLineElement, 0);
pActiveView.Refresh();
//画面
IGeometry Polygon = axMapControl1.TrackPolygon();
IPolygonElement PolygonElement = new PolygonElementClass();
IElement pElement = PolygonElement as IElement;
pElement.Geometry = Polygon;
pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)PolygonElement, 0);
 
 
 
pActiveView.Refresh();

转载于:https://www.cnblogs.com/arxive/p/6885347.html

你可能感兴趣的文章
Spring - DI
查看>>
微软自己的官网介绍 SSL 参数相关
查看>>
Composite UI Application Block (CAB) 概念和术语
查看>>
阶段3 2.Spring_02.程序间耦合_7 分析工厂模式中的问题并改造
查看>>
阶段3 2.Spring_03.Spring的 IOC 和 DI_2 spring中的Ioc前期准备
查看>>
阶段3 2.Spring_09.JdbcTemplate的基本使用_5 JdbcTemplate在spring的ioc中使用
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第11节 Logback日志框架介绍和SpringBoot整合实战_45、SpringBoot2.x日志讲解和Logback配置实战...
查看>>
小D课堂 - 新版本微服务springcloud+Docker教程_4-05 微服务调用方式之feign 实战 订单调用商品服务...
查看>>
技术分析淘宝的超卖宝贝
查看>>
Azure云服务托管恶意软件
查看>>
C#检测驱动是否安装的问题
查看>>
web-4. 装饰页面的图像
查看>>
微信测试账户
查看>>
类中的静态函数和非静态函数的区别
查看>>
windows 下安装Apache
查看>>
Fedora14 mount出现错误时解决办法【亲测有效】
查看>>
Linux----常用操作
查看>>
sequence
查看>>
Delphi错误:Stack overflow的解决方法
查看>>
取消chrome(谷歌浏览器)浏览器下最小字体限制
查看>>