实现在mapcontrol中显示,需要实现画线画点。不是在运行窗口中画而是在加载时候画。传递坐标以及属性进去,在mapcontrol显示。类似于GDI+的画图
如何实现在 ArcGIS Engine 中画图
—- 20分
—- 20分
画点
IPoint pt; pt = axMapControl1.ToMapPoint(e.x, e.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();
画线
IGeometry polyline; polyline = axMapControl1.TrackLine(); ILineElement pLineElement; pLineElement = new LineElementClass(); IElement pElement; pElement = pLineElement as IElement; pElement.Geometry = polyline; pGraphicsContainer = pMap as IGraphicsContainer; pGraphicsContainer.AddElement((IElement)pLineElement, 0); pActiveView.Refresh();
画面
IGeometry Polygon; Polygon = axMapControl1.TrackPolygon(); IPolygonElement PolygonElement; PolygonElement = new PolygonElementClass(); IElement pElement; pElement = PolygonElement as IElement; pElement.Geometry = Polygon; pGraphicsContainer = pMap as IGraphicsContainer; pGraphicsContainer.AddElement((IElement)PolygonElement, 0); pActiveView.Refresh();
—-
用这个无法嵌入互操作类型“ESRI.ArcGIS.Carto.MarkerElementClass”。请改用适用的接口。 该如何解决啊?
—-
LineElementClass这个也是一样的问题
—- 20分
—-
加载时画图?什么需求?
要实现类似于button一样的点击事件,点击后就加载在代码中绘制的图形。或者在运行程序是就加载。该如何实现呢?arcgis engine什么事件符合这种要求呢?
—-
已经基本实现我所需要的东西了 谢谢taomanman的帮助。非常感谢
—-
画点
IPoint pt; pt = axMapControl1.ToMapPoint(e.x, e.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();画线
IGeometry polyline; polyline = axMapControl1.TrackLine(); ILineElement pLineElement; pLineElement = new LineElementClass(); IElement pElement; pElement = pLineElement as IElement; pElement.Geometry = polyline; pGraphicsContainer = pMap as IGraphicsContainer; pGraphicsContainer.AddElement((IElement)pLineElement, 0); pActiveView.Refresh();画面
IGeometry Polygon; Polygon = axMapControl1.TrackPolygon(); IPolygonElement PolygonElement; PolygonElement = new PolygonElementClass(); IElement pElement; pElement = PolygonElement as IElement; pElement.Geometry = Polygon; pGraphicsContainer = pMap as IGraphicsContainer; pGraphicsContainer.AddElement((IElement)PolygonElement, 0); pActiveView.Refresh();用这个无法嵌入互操作类型“ESRI.ArcGIS.Carto.MarkerElementClass”。请改用适用的接口。 该如何解决啊?
解决方案如下:
http://blog.csdn.net/ldl22847/article/details/7275410
绘制多个点并连接其中两个或多个点该如何改写呢? 我绘制的点虽然写了两个点代码,但是只生成一个点。该如何修改呢?
CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明如何实现在 ArcGIS Engine 中画图!