IFeatureIdentifyObj实现闪烁功能

GIS浩淼的天空看到的一篇用IFeatureIdentifyObj实现闪烁功能,不过这方法AE不支持。

Dim  pEnvs  As  IEnvelope
pEnvs 
=  AxMapControl1.TrackRectangle

Dim  pLayer  As  IFeatureLayer
pLayer 
=  pMainMap.Layer( 0 )
Dim  pIdentify  As  IIdentify
pIdentify 
=  pLayer
Dim  pArr  As  IArray
pArr 
=  pIdentify.Identify(pEnvs)

Dim  pFtIdenObj  As  IFeatureIdentifyObj
Dim  pIdenObj  As  IIdentifyObj
If   Not  pArr  Is   Nothing   Then
Dim  j  As   Integer
For  j  =   0   To  pArr.Count  -   1
        pFtIdenObj 
=  pArr.Element(j)
        pIdenObj 
=  pFtIdenObj
        pIdenObj.Flash(pMainAV.ScreenDisplay)
        pIdenObj 
=   Nothing
        pFtIdenObj 
=   Nothing
Next
End   If

 

要在AE实现闪烁功能,一个方法是用IHookActions.DoActions()方法搭上esriHookActionsFlash作为动作。

IHookActions的定义如下  


[Visual Basic 
6.0 ]
ExpandedBlockStart.gifContractedBlock.gif
Sub DoAction() Sub DoAction(    
    
ByVal pUnknown As Unknown, 
    
ByVal Action As esriHookActions  
)

[Visual Basic .NET]
ExpandedSubBlockStart.gifContractedSubBlock.gif
Public Sub DoAction()Sub DoAction ( _
    
ByVal pUnknown As Object, _
    
ByVal Action As esriHookActions _
)

 

pUnknown必须是实现了IEnvelope, IPoint, IPolygon 或者 IPolyline 的geometry对象,

而且该geometry不应该为空。

Action方面有6个constant,可以根据需要选择.

Constant

Value

Description

esriHookActionsFlash

0

Flash the geometry.

esriHookActionsPan

1

Pan to the geometry.

esriHookActionsZoom

2

Zoom to the geometry.

esriHookActionsGraphic

3

Create a graphic for the geometry.

esriHookActionsLabel

4

Create a graphic and label for the geometry.

esriHookActionsCallout

5

Create a callout for the geometry.

 

 完成闪烁的代码如下:

Dim hookActions as IHookActions
hookActions.DoAction(feature.Shape, esriHookActions.esriHookActionsPan)

 Application.DoEvent();
hookActions.DoAction(feature.Shape,esriHookActions.esriHookActionsFlash)

 

转载于:https://www.cnblogs.com/iswszheng/archive/2009/04/14/1436038.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值