HighLight selected features

高亮顯示被選中feature,并可控制非選擇feature顯示或隱藏...

使用IQueryFilter過濾選擇集,利用IFeatureSelection.SelectionSymbol設置被選擇要素的外觀。

IFeatureLayerDefinition.DefinitionExpression用于控制圖層上的要素顯示狀態。

ExpandedBlockStart.gif ContractedBlock.gif Private   Sub SearchSlope() Sub SearchSlope(pLayer As ILayer, strSlopes As String, chkfilterValue As Boolean)
 
    
Dim pFeaturelayer As IFeatureLayer
    
Set pFeaturelayer = pLayer
    
    
Dim pFeatureSelection As IFeatureSelection
    
Set pFeatureSelection = pFeaturelayer
    
    
Dim pDefFeatLayer As IFeatureLayerDefinition
    
Set pDefFeatLayer = pFeaturelayer
    
If chkfilterValue = True Then
        pDefFeatLayer.DefinitionExpression 
= "SLOPENO IN (" & strSlopes & ")"
    
Else
        pDefFeatLayer.DefinitionExpression 
= ""
    
End If
    
    
Dim pFilter As IQueryFilter
    
Set pFilter = New QueryFilter
    pFilter.WhereClause 
= "SLOPENO IN (" & strSlopes & ")"

    
Dim pFillSym As ISimpleFillSymbol
    
Set pFillSym = New SimpleFillSymbol

    pFillSym.Style 
= esriSFSDiagonalCross
    pFeatureSelection.SetSelectionSymbol 
= True

    
Set pFeatureSelection.SelectionSymbol = pFillSym

    pFeatureSelection.SelectFeatures pFilter, esriSelectionResultNew, 
False

 
End Sub

 

转载于:https://www.cnblogs.com/iswszheng/archive/2009/03/18/1415529.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值