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

IFeatureIdentifyObj实现闪烁功能Dim pEnvs As IEnvelope
IFeatureIdentifyObj实现闪烁功能pEnvs 
= AxMapControl1.TrackRectangle
IFeatureIdentifyObj实现闪烁功能
IFeatureIdentifyObj实现闪烁功能
Dim pLayer As IFeatureLayer
IFeatureIdentifyObj实现闪烁功能pLayer 
= pMainMap.Layer(0)
IFeatureIdentifyObj实现闪烁功能
Dim pIdentify As IIdentify
IFeatureIdentifyObj实现闪烁功能pIdentify 
= pLayer
IFeatureIdentifyObj实现闪烁功能
Dim pArr As IArray
IFeatureIdentifyObj实现闪烁功能pArr 
= pIdentify.Identify(pEnvs)
IFeatureIdentifyObj实现闪烁功能
IFeatureIdentifyObj实现闪烁功能
Dim pFtIdenObj As IFeatureIdentifyObj
IFeatureIdentifyObj实现闪烁功能
Dim pIdenObj As IIdentifyObj
IFeatureIdentifyObj实现闪烁功能
If Not pArr Is Nothing Then
IFeatureIdentifyObj实现闪烁功能
Dim j As Integer
IFeatureIdentifyObj实现闪烁功能
For j = 0 To pArr.Count - 1
IFeatureIdentifyObj实现闪烁功能        pFtIdenObj 
= pArr.Element(j)
IFeatureIdentifyObj实现闪烁功能        pIdenObj 
= pFtIdenObj
IFeatureIdentifyObj实现闪烁功能        pIdenObj.Flash(pMainAV.ScreenDisplay)
IFeatureIdentifyObj实现闪烁功能        pIdenObj 
= Nothing
IFeatureIdentifyObj实现闪烁功能        pFtIdenObj 
= Nothing
IFeatureIdentifyObj实现闪烁功能
Next
IFeatureIdentifyObj实现闪烁功能
End If

 

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

IHookActions的定义如下  

IFeatureIdentifyObj实现闪烁功能
IFeatureIdentifyObj实现闪烁功能[Visual Basic 
6.0]

 

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.

 

 完成闪烁的代码如下:

IFeatureIdentifyObj实现闪烁功能Dim hookActions as IHookActions
IFeatureIdentifyObj实现闪烁功能hookActions.DoAction(feature.Shape, esriHookActions.esriHookActionsPan)

 Application.DoEvent();
IFeatureIdentifyObj实现闪烁功能hookActions.DoAction(feature.Shape,esriHookActions.esriHookActionsFlash)

 

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2021-10-24
猜你喜欢
  • 2022-12-23
  • 2021-06-01
  • 2021-12-24
  • 2022-01-18
  • 2022-12-23
  • 2022-01-19
  • 2021-12-19
相关资源
相似解决方案