C# ArcEngine,如何根据已有的两点的XY坐标,把这条线在地图上显示出来?
有几十条线,线的首尾端坐标都已知,在数据库内存放,如何通过C#,把这些线在ArcEngine控件内显示出来?...
有几十条线,线的首尾端坐标都已知,在数据库内存放,如何通过C#,把这些线在ArcEngine控件内显示出来?
展开
2个回答
展开全部
IPoint p1 = new PointClass();
IPoint p2 = new PointClass();
p1.X = 75;
p1.Y = 5;
p2.X = 75;
p2.Y = 65;
ILine DisplayLine = new LineClass();
DisplayLine.PutCoords(p1, p2);
IPoint p2 = new PointClass();
p1.X = 75;
p1.Y = 5;
p2.X = 75;
p2.Y = 65;
ILine DisplayLine = new LineClass();
DisplayLine.PutCoords(p1, p2);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐于2016-12-02
展开全部
IPoint pt;
pt = new Point();
pt.x=_x;pt.y =_y;
IMarkerElement pMarkerElement;
pMarkerElement = new MarkerElementClass();
IElement pElement;
pElement = pMarkerElement as IElement;
pElement.Geometry = pt;
pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)pMarkerElement, 0);
pActiveView.Refresh();
pt = new Point();
pt.x=_x;pt.y =_y;
IMarkerElement pMarkerElement;
pMarkerElement = new MarkerElementClass();
IElement pElement;
pElement = pMarkerElement as IElement;
pElement.Geometry = pt;
pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)pMarkerElement, 0);
pActiveView.Refresh();
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询