c#操作styline模型左键点击模型获取坐标,完成画线操作。
1:鼠标点击模型事件
List pos = new List(); private bool Sgworld_OnLButtonClicked(int Flags, int X, int Y) { var sgworld = new SGWorld66(); var postioninfo = sgworld.Window.PixelToWorld(X, Y); IPosition66 ss = postioninfo.Position; ss.X = postioninfo.Position.X; ss.Y = postioninfo.Position.Y; pos.Add(ss); return false; }
登录后复制
2:操作画线
string tMsg = String.Empty; ILinearRing cRing = null; IGeometry cPolygonGeometry = null; ITerrainPolyline66 cpolyo = null; //创建实例 //MessageBox.Show(String.Format("X:{0}Y:{1}", posl[i].PosX, posl[i].PosX)); var sgworld = new SGWorld66(); List posl = pos; int sin = 0; sin = posl.Count*3; double[] cVerticesArray = new double[sin]; //获取坐标值 for (int i = 0; i
登录后复制
以上就是C#操作Styline二次开发实现画线功能的详细内容,更多请关注【创想鸟】其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2493168.html