当前位置:网站首页>如何实现临时的图形要素现实
如何实现临时的图形要素现实
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);
边栏推荐
- 【机器学习小记】【风格迁移】deeplearning.ai course4 4th week programming(tensorflow2)
- Unit test, what is unit test and why is it so difficult to write a single test
- C语言计算日期间隔天数
- 2022/07/25------字符串的排列
- json_object_put: Assertion `jso->_ref_count > 0‘ failed.Aborted (core dumped)
- 粽子大战 —— 猜猜谁能赢
- C language calculation date interval days
- 父类对子类的引用(父类引用指向子类对象)
- Function template parameters (where are the function parameters)
- [Halcon vision] affine transformation
猜你喜欢
STM32 阿里云MQTT esp8266 AT命令
404页面和路由钩子
[Halcon vision] image filtering
Problems encountered in QRcode QR code (C language)
[Halcon vision] image gray change
[Halcon vision] affine transformation
GIS方法类期刊和论文的综述(Introduction)怎么写?
Centos8 (liunx) deploying WTM (asp.net 5) using PgSQL
Comparison of packet capturing tools fiddler and Wireshark
canvas上传图片base64-有裁剪功能-Jcrop.js
随机推荐
同步方法中不使用asyncTask<T> 修饰和await获取异步返回值(同步方法中调用异步方法)
上传图片获取宽高
[leetcode每日一题2021/4/23]368. 最大整除子集
SAP ABAP Netweaver 容器化的一些前沿性研究工作分享
.net operation redis list list
Kaptcha image verification code integration
Introduction to Phoenix (Level 1: Phoenix installation, level 2: Phoenix basic grammar)
.net operation redis set unordered collection
Parallelism, concurrency and several directions for high concurrency optimization
Mlx90640 infrared thermal imager temperature sensor module development notes (VI) pseudo color coding of infrared images
11 在 operator= 中处理“自我赋值”
Oracle创建索引
centos8(liunx)部署WTM(ASP.NET 5)使用pgsql
Asynctask < T> decoration and await are not used in synchronous methods to obtain asynchronous return values (asynchronous methods are called in synchronous methods)
[C language] LINQ overview
10 令 operator= 返回一个 reference to *this
2022pta usual training questions (1-10 string processing questions)
Problems encountered in QRcode QR code (C language)
Redis特殊数据类型使用场景
vscode上使用anaconda(已经配置好环境)