lzhanddsh 发表于 2010-8-23 12:18:00

[求助]如何实现给定范围的窗口缩放?

Point2d pt1 = new Point2d(20700, 3600);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Point2d pt2 = new Point2d(21500, 4300);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Point2dCollection ptSet = new Point2dCollection();&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;ptSet.Add(pt1);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;ptSet.Add(pt2);<br/><br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Point2d[] aa = new Point2d;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;ptSet.CopyTo(aa, 0);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;object[] bb = new object;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;bb = aa;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;bb = aa;<br/><br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;object app = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Type acApp = Type.GetTypeFromHandle(Type.GetTypeHandle(app));<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;acApp.InvokeMember("ZoomWindow", BindingFlags.InvokeMethod, null, app, bb);//参数&nbsp;&nbsp;窗口缩放 <br/><br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;打算根据给定窗口角点坐标实现窗口缩放,代码执行总是出现问题,“值不在预期的范围内”,请各位高手指点!<br/>

雪山飞狐_lzh 发表于 2010-8-23 13:36:00

Com库的点是double数组而不是Point2d
页: [1]
查看完整版本: [求助]如何实现给定范围的窗口缩放?