public void OnMouseDown(int Button, int Shift, int X, int Y)
{
IMxDocument mxDoc = m_App.Document as IMxDocument;
IActiveView activeView = mxDoc.FocusMap as IActiveView;
IScreenDisplay screenDisplay = activeView.ScreenDisplay;
ISimpleLineSymbol lineSymbol = new SimpleLineSymbolClass();
IRgbColor rgbColor = new RgbColorClass();
rgbColor.Red = 255;
lineSymbol.Color = rgbColor;
IRubberBand rubberLine = new RubberLineClass();
IPolyline newPolyline = (IPolyline)rubberLine.TrackNew(screenDisplay, (ISymbol)lineSymbol);
screenDisplay.StartDrawing(screenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
screenDisplay.SetSymbol((ISymbol)lineSymbol);
screenDisplay.DrawPolyline(newPolyline);
screenDisplay.FinishDrawing();
}
这是绘制折线的功能。但我希望折线会自动存储在“线”层中,这可能吗?