当前位置:网站首页>如何实现临时的图形要素现实
如何实现临时的图形要素现实
2022-07-26 10:34:00 【WindOfMayGIS】
如何实现临时的图形要素现实
一需求说明:
需要将处理结果进行显示出来,给自己或者用户看,而不需要存储下来。
二实现思路:
1.实例化Element ,之后将Element放到IGraphicsContainer中,再使用IActiveView刷新出来;
或者
2.实例化Element ,将Element放到IElementCollection中,再使用IGraphicsContainer和IActiveView加载刷新显示出来。
此处需要注意的是:如果需要将Line对象放进来之后进行临时显示的话,需要先将LINE转为Polyline之后再放进来,不然会提示“值不在范围内”。
- ISegmentCollection gc = new PolylineClass();
- gc.AddSegment(line as ISegment);
- IPolyline polyline = gc as IPolyline;
三代码参考:
//生成Element对象,存放到ElementCollection中
publicIElementCollectionGeoColl = newElementCollection();
ITextElement pele1 = newTextElementClass();
pele1.Text = "。";
pele1.ScaleText = true;
IPoint pTempPoint4 = newPointClass();
pTempPoint4.PutCoords(xLoc1, yLoc1);
IElement pElement1 = pele1 asIElement;
pElement1.Geometry =pTempPoint4;
GeoColl.Add(pElement1);
//将ElementCollection通过IGraphicsContainer和IActiveView加载刷新显示出来
IActiveView pActiveView =axMapControl1.Map asIActiveView;
IGraphicsContainerpGraphicsContainer = axMapControl1.Map asIGraphicsContainer;
pGraphicsContainer.AddElements(LocFactory.GeoColl, 0);
pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
边栏推荐
- Simple use of json-c Library -- converting JSON files to struct
- [Halcon vision] array
- Inheritance method of simplified constructor (I) - combined inheritance
- QRcode二维码(C语言)遇到的问题
- STM32 阿里云MQTT esp8266 AT命令
- Function templates and non template functions with the same name cannot be overloaded (definition of overloads)
- datav漂亮数据屏制作体验
- [Halcon vision] polar coordinate transformation
- 第8期:云原生—— 大学生职场小白该如何学
- cavans实现静态滚动弹幕
猜你喜欢
![[leetcode每日一题2021/5/8]1723. 完成所有工作的最短时间](/img/e7/a48bb5b8a86cbc4cd5b37bb16661a8.png)
[leetcode每日一题2021/5/8]1723. 完成所有工作的最短时间

Analysis of the transaction problem of chained method call
The software cannot be opened
![[leetcode每日一题2021/8/30]528. 按权重随机选择【中等】](/img/13/c6cb176d7065035f60d55ad20ed1bf.png)
[leetcode每日一题2021/8/30]528. 按权重随机选择【中等】

码云,正式支持 Pages 功能,可以部署静态页面

SAP ABAP Netweaver 容器化的一些前沿性研究工作分享
![[leetcode每日一题2021/4/29]403. 青蛙过河](/img/fb/612777c77df5a611506e72f4f4c3c8.png)
[leetcode每日一题2021/4/29]403. 青蛙过河

Tradingview 使用教程

【机器学习小记】【风格迁移】deeplearning.ai course4 4th week programming(tensorflow2)

异常的概念与处理
随机推荐
algorithm
Function templates and non template functions with the same name cannot be overloaded (definition of overloads)
Introduction to data analysis | kaggle Titanic mission
SAP ABAP Netweaver 容器化的一些前沿性研究工作分享
[Halcon vision] Fourier transform of image
Unit test, what is unit test and why is it so difficult to write a single test
10 令 operator= 返回一个 reference to *this
Oracle创建索引
[Halcon vision] threshold segmentation
常见的类(了解)
MD5 encryption
干货likeshop外卖点餐系统开源啦100%开源无加密
js 获得当前时间,时间与时间戳的转换
The problem of large fluctuation of hx711 data
【机器学习小记】【搭建循环神经网络及其应用】deeplearning.ai course5 1st week programming(keras)
2022/07/25------字符串的排列
Our Web3 entrepreneurship project is yellow
Write to esp8266 burning brush firmware
.net5wtm (asp.net core) PgSQL unpacking operation
[gossip] error loading psychopg2 module: no module named psychopg2