ArcEngine开发问题总结

问题:遇到'异常来自 HRESULT:0x80040228’

解决方法:添加一个license控件就行了.

参考:http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=14967

 

问题:遇到‘ArcGIS version not specified. You must call RuntimeManager.Bind before creating any ArcGIS components.’

解决方法:

View Code
/// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
        //添加一下语句    ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

 

问题:

解决办法:

将嵌入互操作类型设置为false。

 

问题:如何利用点连接成线

解决代码

View Code
 1  IPoint pPoint1;
 2             IPoint pPoint2;
 3             pPoint1 = new PointClass();
 4             pPoint1.PutCoords(100, 20);
 5             pPoint1.Z = 80;
 6             pPoint2 = new PointClass();
 7             pPoint2.PutCoords(20, 310);
 8             pPoint2.Z = 100;
 9             IGeometryCollection pPolyline;
10             pPolyline = new PolylineClass();
11             ISegmentCollection pPath;
12             pPath = new PathClass();
13             ILine pLine;
14             object Missing1 = Type.Missing;
15             object Missing2 = Type.Missing;
16             pLine = new LineClass();
17             pLine.PutCoords(pPoint1, pPoint2);
18             pPath.AddSegment(pLine as ISegment, ref Missing1, ref Missing2);
19             pPolyline.AddGeometry(pPath as IGeometry, ref Missing1, ref Missing2);
20              IPoint pPoint3;
21             IPoint pPoint4;
22             pPoint3 = new PointClass();
23             pPoint3.PutCoords(1100, 20);
24             pPoint3.Z = 80;
25             pPoint4 = new PointClass();
26             pPoint4.PutCoords(210, 310);
27             pPoint4.Z = 100;
28             IGeometryCollection pPolyline1;
29             pPolyline1 = new PolylineClass();
30             ISegmentCollection pPath1;
31             pPath1 = new PathClass();
32             ILine pLine1;
33       
34             pLine1 = new LineClass();
35             pLine1.PutCoords(pPoint3, pPoint4);
36             pPath1.AddSegment(pLine1 as ISegment, ref Missing1, ref Missing2);
37             pPolyline.AddGeometry(pPath1 as IGeometry, ref Missing1, ref Missing2);
38             IPolyline polygon=(IPolyline)pPolyline;
39             object o = null;
40             //axMapControl1.DrawShape
41             axMapControl1.DrawShape(polygon, ref o);

参考:兰小机 刘德儿

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/xjzhangdc/archive/2013/03/20/2971360.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值