arcengine 画线
private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
{
ILineElement pLineElement;
IActiveView pActiveView;
IRgbColor pRgbColor;
IRubberBand pRubberBand;
ISimpleLineSymbol pSimpleLineSymbol;
IPolyline pPloyline;
pActiveView = axMapControl1.ActiveView;
pSimpleLineSymbol = new SimpleLineSymbolClass();
pSimpleLineSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
pRgbColor = new RgbColorClass();
pRgbColor.Red = 125;
pSimpleLineSymbol.Color = pRgbColor;
pRubberBand = new RubberLineClass();
pLineElement = new LineElementClass();
pLineElement.Symbol = pSimpleLineSymbol;
pPloyline = pRubberBand.TrackNew(pActiveView.ScreenDisplay, pSimpleLineSymbol as ISymbol) as IPolyline;
pElement = new LineElement();
pElement = pLineElement as IElement;
pElement.Geometry = pPloyline;
IGraphicsContainer pGraphicsContainer = axMapControl1.ActiveView.FocusMap as IGraphicsContainer;
pGraphicsContainer.AddElement(pElement, 0);
axMapControl1.ActiveView.Refresh();
}
作者:jinqier
出处:http://www.cnblogs.com/jinqier/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。