ArcEngine 将圆形、矩形转换为多边形 ;ICircularArc、IEnvelope转化为IPolygon
来源:互联网 发布:数据库的事物是什么 编辑:程序博客网 时间:2024/06/14 01:11
1、将ICircularArc转化为IPolygon
1: ICircularArc pCircularArc = null; 2: IRubberBand pRubberBand = new RubberCircleClass(); 3: pCircularArc = pRubberBand.TrackNew(axMapControl_Main.ActiveView.ScreenDisplay, null) as ICircularArc; 4: if (pCircularArc == null) 5: return; 6: object missing = Type.Missing; 7: ISegmentCollection pSegmentColl = new RingClass(); 8: pSegmentColl.AddSegment((ISegment)pCircularArc, ref missing, ref missing); 9: IRing pRing = (IRing)pSegmentColl; 10: pRing.Close(); //得到闭合的环 11: IGeometryCollection pGeometryCollection = new PolygonClass(); 12: pGeometryCollection.AddGeometry(pRing, ref missing, ref missing); //环转面 13: IPolygon pPolygon = (IPolygon)pGeometryCollection;
2、将IEnvelope转化为IPolygon
1: IEnvelope pEnvelope = null; 2: IRubberBand pRubberBand = new RubberEnvelopeClass(); 3: pEnvelope = pRubberBand.TrackNew(axMapControl_Main.ActiveView.ScreenDisplay, null) as IEnvelope; 4: if (pEnvelope == null) 5: return; 6: IPoint p1 = new PointClass(); 7: IPoint p2 = new PointClass(); 8: IPoint p3 = new PointClass(); 9: IPoint p4 = new PointClass(); 10: p1 = pEnvelope.UpperLeft; 11: p2 = pEnvelope.LowerLeft; 12: p3 = pEnvelope.LowerRight; 13: p4 = pEnvelope.UpperRight; 14: IPointCollection pPointCollection = new PolygonClass(); 15: object missing = Type.Missing; 16: pPointCollection.AddPoint(p1, ref missing, ref missing); 17: pPointCollection.AddPoint(p2, ref missing, ref missing); 18: pPointCollection.AddPoint(p3, ref missing, ref missing); 19: pPointCollection.AddPoint(p4, ref missing, ref missing); 20: IPolygon pPolygon = (IPolygon)pPointCollection;
完成以后记得使用ITopologicalOperator.Simplify()进行处理,可以处理面自动闭合等问题
注意:在给IPointCollection添加点的时候要按照一定的顺序添加(按照顺时针或者逆时针的顺序选取起点进行添加,否则会使得图形发生变化)
阅读全文
0 0
- ArcEngine 将圆形、矩形转换为多边形 ;ICircularArc、IEnvelope转化为IPolygon
- Arcengine中IEnvelope为IPolygon
- BitmapShader将图片转化为圆形图片
- Android将BitMap转化为圆形
- bitmap将头像转换为圆形头像
- android将图片转换为圆形图片
- Maya 将NURBS转化为多边形选项设置
- android之将图片转化为圆形图片
- android之将图片转化为圆形图片
- 将矩形图像转化为正方形(两边补像素)
- Android中使用Picasso将图片直接转换为圆形
- ArcEngine 无法将类型为"Systerm._ComObject"的对象强制转换为类型******
- 将图片剪裁为圆形
- 注释转换:将代码注释转化为C++注释
- 如何将图片中的一个任意四边形区域的图像转化为矩形【附源码】
- 将Ip转化为十进制数字,将十进制数字转化为Ip
- 将bmp 转化为avi
- 将体能转化为智能
- 搜索学习入门--Lucene初体验(Lucene索引的增删改查)
- Oracle之表/视图名称大小写问题-yellowcong
- Spring之bean作用域(JAVASE)
- JDK1.8环境变量配置
- 基于ESP8266的微信门铃
- ArcEngine 将圆形、矩形转换为多边形 ;ICircularArc、IEnvelope转化为IPolygon
- 将String转化为String数组
- vue生命周期钩子函数
- 51 软件模拟SPI驱动OLED
- C++plus笔记6
- HTTP请求之GET,POST,DELETE,PUT
- 客户流失模型
- 惠普服务器 Smart Array 系列阵列卡常见 1700 系列报错
- 【python】HTTP 文件下载