|
阅读:2286回复:3
ArcEngine+c#,求角平分线?
<P>我想由三点坐标来做角平分线,用IConstructLine 的ConstructAngleBisector是否合适?</P>
<P>代码如下,但输出时有错误:未将对象引用设置到对象的实例。错在那里呢,请指教.</P> <P>private void button1_Click(object sender, System.EventArgs e)<BR> {this.mx1 = Convert.ToDouble(this.textBox1.Text.Trim() );<BR> this.my1 = Convert.ToDouble(this.textBox2.Text.Trim() );<BR> this.mx2 = Convert.ToDouble( this.textBox3.Text.Trim() );;<BR> this.my2 = Convert.ToDouble(this.textBox4.Text.Trim() );<BR> this.mx3 = Convert.ToDouble(this.textBox5.Text.Trim() );<BR> this.my3 = Convert.ToDouble(this.textBox6.Text.Trim());<BR> IPoint pt1=new PointClass();<BR> IPoint pt2=new PointClass();<BR> IPoint pt3=new PointClass();<BR> pt1.X=mx1;<BR> pt1.Y=my1 ;<BR> pt2.X=mx2 ;<BR> pt2.Y=my2 ;<BR> pt3.X=mx3 ;<BR> pt3.Y=my3 ;<BR> IConstructLine pline =new LineClass() ;<BR> //ILine pl= new LineClass() ;<BR> pline.ConstructAngleBisector (pt2,pt1,pt3,20,false) ;<BR> <BR> <BR> this._pMapCtrl.DrawShape( pline as IGeometry, ref this.oPtSym );<BR> }</P> |
|
|
1楼#
发布于:2006-09-26 11:32
<P>错误信息是:</P>
<P>未处理的“System.Runtime.InteropServices.COMException”类型的异常出现在 mscorlib.dll 中。</P> <P>其他信息: The supplied geometry does not have a geometry type that is supported for drawing<BR></P> |
|
|
2楼#
发布于:2009-02-18 00:27
<P>问题似乎是出在 drawshap 这个方法上,我最近也遇到了这样的问题</P>
|
|
|
3楼#
发布于:2009-03-07 10:34
这里最好对IConstructLine进行检测
|
|
|