阅读:1667回复:0
AO 跟踪
<P>public static IGeometryCollection MakeMultipoint(IGeometry pGeo, int nPtCount)<BR> {<BR> IConstructGeometryCollection pConstructGeo;<BR> IGeometryCollection pGeometryCollection;<BR> if (pGeo is IPolyline)<BR> {<BR> pConstructGeo = new GeometryBagClass();<BR> pConstructGeo.ConstructDivideEqual(pGeo as IPolyline, nPtCount, esriConstructDivideEnum.esriDivideIntoPolylines);</P>
<P> IEnumGeometry pEnumGeometry;<BR> pEnumGeometry = pConstructGeo as IEnumGeometry;</P> <P><BR> IEnumGeometry</P> <P> pGeometryCollection = new MultipointClass();<BR> IPolyline pPolyline;<BR> pPolyline = pEnumGeometry.Next() as IPolyline;<BR> object Missing1 = Type.Missing;<BR> object Missing2 = Type.Missing;<BR> pGeometryCollection.AddGeometry(pPolyline.FromPoint, ref Missing1, ref Missing2);<BR> while (pPolyline != null)<BR> {<BR> pGeometryCollection.AddGeometry(pPolyline.ToPoint, ref Missing1, ref Missing2);<BR> pPolyline = pEnumGeometry.Next() as IPolyline;</P> <P> }<BR> return pGeometryCollection;<BR> }<BR> else<BR> return null; <BR> }</P> <P> private void timer1_Tick(object sender, EventArgs e)<BR> {<BR> IPoint pPt;</P> <P> if (j >= pPointCol.PointCount)<BR> {<BR> this.timer1.Enabled = false;<BR> this.timer1.Stop();<BR> }<BR> else<BR> {<BR> pPt = pPointCol.get_Point(j);<BR> j = j + 1;<BR> IMarkerElement pElek = new MarkerElementClass();<BR> IMarkerSymbol ps = new SimpleMarkerSymbolClass();<BR> IRgbColor icr = new RgbColorClass();<BR> icr.RGB = 150;<BR> ps.Color = icr;<BR> pElek.Symbol = ps;<BR> IElement pe = pElek as IElement;<BR> pe.Geometry = pPt;<BR> IGraphicsContainer pGraphicsContainer = axMapControl1.Map as IGraphicsContainer;<BR> pGraphicsContainer.AddElement(pe, 0);<BR> axMapControl1.Refresh(esriViewDrawPhase.esriViewGraphics, null, null);<BR> }<BR> }<BR></P> |
|