AE画点线,如何画多个点和多线段?

qq_17490191 2014-11-29 08:27:16
在VS2010arcgis engine中mapcontrol中操作,实现点击触发一个点击事件,或者运行就直接加载,自动加载代码中添加的坐标值和线段属性画图。
...全文
3734 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
V四月雪V 2015-08-31
  • 打赏
  • 举报
回复
先获取点的坐标,再依次添加。
qq_17490191 2014-12-05
  • 打赏
  • 举报
回复
引用 10 楼 surveydd 的回复:
最后面少加了一个}
用你的方法可以画多个点,但是我画的点不是按规律增长坐标的 而是如坐标200,300 是一个点,坐标400,500也是一个点,该如何修改呢?请指教
小猫112 2014-12-04
  • 打赏
  • 举报
回复
最后面少加了一个}
小猫112 2014-12-04
  • 打赏
  • 举报
回复
//首先要实现容器接口 IGraphicsContainer pGraphicsContainer = axMapControl1.ActiveView as IGraphicsContainer; pGraphicsContainer.DeleteAllElements();//清空容器里面所有的元素 //设置点的坐标 for (int i = 0; i <= 100; i = i + 10) { IPoint pPoint = new PointClass(); pPoint.PutCoords(300 + i, 300 + i); //IMarkerElement用来获得symbol属性 IMarkerElement pMarkerElement = new MarkerElementClass(); //用ISimpleMarkerSymbol来设置点的属性 ISimpleMarkerSymbol pSymbol = new SimpleMarkerSymbolClass(); IRgbColor pRGBcolor = new RgbColorClass(); pRGBcolor.Red = 255; pRGBcolor.Green = 0; pRGBcolor.Blue = 0; pSymbol.Color = pRGBcolor;//红色 pMarkerElement.Symbol = pSymbol; //IElement用来获得Geometry属性 IElement pElement = pMarkerElement as IElement; //把IPoint转换为为IGeoMetry也能实现 //IGeometry pGeometry = pPoint as IGeometry; //pElement.Geometry = pGeometry; pElement.Geometry = pPoint; //在容器里添加元素 pGraphicsContainer.AddElement(pElement, 0); pElement.Activate(axMapControl1.ActiveView.ScreenDisplay); axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, pElement, null);
dreamgis 2014-12-02
  • 打赏
  • 举报
回复
楼上说的对,多执行几次画点的代码,把每个点的坐标弄成不同的,就可以了
Justin-Liu 2014-12-01
  • 打赏
  • 举报
回复
你能画一个点,不会画多个???
clever101 2014-11-30
  • 打赏
  • 举报
回复
引用 4 楼 qq_17490191 的回复:
[quote=引用 2 楼 clever101 的回复:] 具体参考: ARCGIS ENGINE + C#画点、线、面
我用你发的方法出现未将对象引用设置到对象的实例,该如何解决?可以指导一下吗?谢谢[/quote] 既然你都知道在容器里添加元素了 pGraphicsContainer.AddElement(pElement, 0); 那么你想添加几个点,不就是定义几个Element,再把它们都AddElement不就行了吗?
qq_17490191 2014-11-30
  • 打赏
  • 举报
回复
引用 2 楼 clever101 的回复:
具体参考: ARCGIS ENGINE + C#画点、线、面
我用你发的方法出现未将对象引用设置到对象的实例,该如何解决?可以指导一下吗?谢谢
qq_17490191 2014-11-30
  • 打赏
  • 举报
回复
引用 2 楼 clever101 的回复:
具体参考: ARCGIS ENGINE + C#画点、线、面
如何画多个点呢?表示不会,可以为我讲解一下吗?
clever101 2014-11-29
  • 打赏
  • 举报
回复
qq_17490191 2014-11-29
  • 打赏
  • 举报
回复
private void button1_Click(object sender, EventArgs e) { //首先要实现容器接口 IGraphicsContainer pGraphicsContainer = axMapControl1.ActiveView as IGraphicsContainer; pGraphicsContainer.DeleteAllElements();//清空容器里面所有的元素 //设置点的坐标 IPoint pPoint = new PointClass(); pPoint.PutCoords(310, 310); //IMarkerElement用来获得symbol属性 IMarkerElement pMarkerElement = new MarkerElementClass(); //用ISimpleMarkerSymbol来设置点的属性 ISimpleMarkerSymbol pSymbol = new SimpleMarkerSymbolClass(); IRgbColor pRGBcolor = new RgbColorClass(); pRGBcolor.Red = 255; pRGBcolor.Green = 0; pRGBcolor.Blue = 0; pSymbol.Color = pRGBcolor;//红色 pMarkerElement.Symbol = pSymbol; //IElement用来获得Geometry属性 IElement pElement = pMarkerElement as IElement; //把IPoint转换为为IGeoMetry也能实现 //IGeometry pGeometry = pPoint as IGeometry; //pElement.Geometry = pGeometry; pElement.Geometry = pPoint; //在容器里添加元素 pGraphicsContainer.AddElement(pElement, 0); pElement.Activate(axMapControl1.ActiveView.ScreenDisplay); axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, pElement, null); } 这是我的画点代码,但是只能画一个点,请教怎么画多个点?

2,143

社区成员

发帖
与我相关
我的任务
社区描述
它是一种特定的十分重要的空间信息系统。它是在计算机硬、软件系统支持下,对整个或部分地球表层(包括大气层)空间中的有关地理分布数据进行采集、储存、管理、运算、分析、显示和描述的技术系统。
社区管理员
  • 地理信息系统
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧