阅读:849回复:0
改变feature的颜色怎么无效?
<P>一个层中都是点feature,用3D符号显示,我现在要改变其中一个feature的颜色,不用管什么feature属性,就是改变这个feature的显示颜色.怎么不行啊,我把代码贴出来麻烦大侠帮我看看啊</P>
<P> Dim pFeatLyr As IFeatureLayer<BR> Dim pGeoFeatLyr As IGeoFeatureLayer<BR> Dim pFC As IFeatureCursor<BR> Dim pFeat As IFeature<BR> Dim pLayer As ILayer<BR> Dim pPtSymbol As IMarkerSymbol<BR> Dim pSRenderer As IFeatureRenderer<BR> <BR> Dim pRgbColor As IRgbColor<BR> Set pRgbColor = New RgbColor<BR> pRgbColor.Blue = 0<BR> pRgbColor.Green = 0<BR> pRgbColor.Red = 255<BR> <BR> Set pLayer = SceneControl1.Scene.Layer(0)<BR> Set pFeatLyr = pLayer<BR> Set pFC = pFeatLyr.Search(Nothing, True)<BR> Set pFeat = pFC.NextFeature<BR> Set pGeoFeatLyr = pFeatLyr</P> <P> <BR> Set pSRenderer = pGeoFeatLyr.Renderer<BR> Set pPtSymbol = pSRenderer.SymbolByFeature(pFeat)<BR> pPtSymbol.Color = pRgbColor<BR> <BR> <BR> SceneControl1.Scene.SceneGraph.RefreshViewers</P> <P>运行不报错,但没有什么反应.</P> |
|