以前曾经写过一篇blog介绍如何使用自定义的方法来实现要素闪烁,除了使用控件的flash方法,的确可以通过自己编写代码的方法,其实就是拿ScreenDisplay对象做文章。今天再看《Exploring ArcObjects》的时候,突然发现一个接口IIdentify的返回对象IFeatureIdentifyObj也可以实现这个功能。特摘录代码如下:
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
(本文已被浏览 次) | | |