阅读:2778回复:5
[求助]闪烁所选择的Features[AO]
现在给定条件选择到一些记录,想把他们同时闪烁,可以吗?有做过的吗?
怎么闪烁呢?一个Feature容易闪烁,把选择到的Features同时闪烁,怎么做呢<img src="images/post/smile/dvbbs/em12.gif" /> |
|
|
1楼#
发布于:2004-08-23 15:06
<P>以下这个例子是针对点集的。</P>
<P>Hxxp://forums.esri.com/Thread.asp?c=93;f=993;t=98048#273527</P> <P> Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Sub UIButtonControl1_Click()</P> <P>Dim pDoc As IMxDocument Set pDoc = ThisDocument</P> <P>Dim pMap As IMap Set pMap = pDoc.FocusMap</P> <P>Dim pFL As IFeatureLayer Set pFL = pMap.Layer(0)</P> <P>Dim pFCursor As IFeatureCursor Set pFCursor = pFL.Search(Nothing, False)</P> <P>Dim pPointCollection As IPointCollection Set pPointCollection = New Multipoint</P> <P>Dim pF As IFeature</P> <P>Set pF = pFCursor.NextFeature</P> <P>Do While Not pF Is Nothing pPointCollection.AddPoint pF.Shape Set pF = pFCursor.NextFeature Loop</P> <P>FlashGeometry pPointCollection</P> <P>End Sub ' effet visuel 'flash sur un objet 'en entree : la geometry de l'objet (pFeatrue.Shape) 'en sortie : Public Sub FlashGeometry(pGeo As esriCore.IGeometry) Dim pDisplay As IScreenDisplay Dim Cache As Integer Dim pCartographicLineSymbol As ICartographicLineSymbol Dim pSimpleFillSymbol As ISimpleFillSymbol Dim pSimpleMarkersymbol As ISimpleMarkerSymbol Dim pLineDecoration As ILineDecoration Dim pLineProperties As ILineProperties Dim pLineDecElement As ISimpleLineDecorationElement Dim pAMSymbol As IArrowMarkerSymbol Dim pSymbol As ISymbol Dim pColor As IRgbColor Dim Interval As Long Dim Size As Long</P> <P> Dim pApp As IMxApplication Set pApp = Application Set pDisplay = pApp.Display 'Set pDisplay = m_pEditor.Display Set pColor = New RgbColor pColor.Green = 150 Interval = 500 Size = 9 Cache = pDisplay.ActiveCache 'Original Cache pDisplay.ActiveCache = esriNoScreenCache pDisplay.StartDrawing pDisplay.hDC, esriNoScreenCache</P> <P> Select Case pGeo.GeometryType Case esriGeometryPolyline Set pAMSymbol = New ArrowMarkerSymbol pAMSymbol.Style = esriAMSPlain pAMSymbol.Size = 12 pAMSymbol.Color = pColor Set pLineProperties = pCartographicLineSymbol 'QI Set pLineDecElement = New SimpleLineDecorationElement pLineDecElement.Rotate = True pLineDecElement.MarkerSymbol = pAMSymbol pLineDecElement.AddPosition (1) Set pLineDecoration = New LineDecoration pLineDecoration.AddElement pLineDecElement Set pCartographicLineSymbol = New CartographicLineSymbol Set pSymbol = pCartographicLineSymbol 'QI pSymbol.ROP2 = esriROPNotXOrPen 'erase itself when drawn twice pCartographicLineSymbol.Width = Size pCartographicLineSymbol.Color = pColor pDisplay.SetSymbol pSymbol pDisplay.DrawPolyline pGeo pLineDecoration.Draw pDisplay.hDC, pDisplay.DisplayTransformation, pGeo Sleep Interval pDisplay.DrawPolyline pGeo pLineDecoration.Draw pDisplay.hDC, pDisplay.DisplayTransformation, pGeo Case esriGeometryPolygon Set pSimpleFillSymbol = New SimpleFillSymbol Set pSymbol = pSimpleFillSymbol pSymbol.ROP2 = esriROPNotXOrPen pSimpleFillSymbol.Color = pColor pDisplay.SetSymbol pSimpleFillSymbol pDisplay.DrawPolygon pGeo Sleep Interval pDisplay.DrawPolygon pGeo Case esriGeometryPoint Set pSimpleMarkersymbol = New SimpleMarkerSymbol Set pSymbol = pSimpleMarkersymbol pSymbol.ROP2 = esriROPNotXOrPen pSimpleMarkersymbol.Color = pColor pSimpleMarkersymbol.Size = Size pDisplay.SetSymbol pSimpleMarkersymbol pDisplay.DrawPoint pGeo Sleep Interval pDisplay.DrawPoint pGeo Case esriGeometryMultipoint Set pSimpleMarkersymbol = New SimpleMarkerSymbol Set pSymbol = pSimpleMarkersymbol pSymbol.ROP2 = esriROPNotXOrPen pSimpleMarkersymbol.Color = pColor pSimpleMarkersymbol.Size = Size pDisplay.SetSymbol pSimpleMarkersymbol pDisplay.DrawMultipoint pGeo Sleep Interval pDisplay.DrawMultipoint pGeo</P> <P> Case Else ' Other type End Select pDisplay.FinishDrawing 'reset the cache pDisplay.ActiveCache = Cache</P> <P>End Sub</P> [此贴子已经被作者于2004-8-23 15:06:29编辑过]
|
|
|
2楼#
发布于:2004-08-23 15:09
<P>hxxp://forums.esri.com/Thread.asp?c=93;f=993;t=119751#344355</P>
|
|
|
3楼#
发布于:2006-09-14 17:39
<P>急需~</P><img src="images/post/smile/dvbbs/em02.gif" />
|
|
4楼#
发布于:2006-09-15 12:12
<img src="images/post/smile/dvbbs/em01.gif" />
|
|
|
5楼#
发布于:2006-09-16 02:29
超级简单,哪里还需要写这么长的代码,如果是点,你就构造一个点集,如果是多边形或多义线,你就使用geometrybag,构造一个新的要素,闪烁即可
|
|