|
阅读:1697回复:2
如何用C#实现identify的功能啊?
<P>在帮助里面看到的vb的代码:</P><PRE>[Visual Basic 6.0]<BR>Private Sub UIToolControl1_MouseDown(ByVal button As Long, _
ByVal shift As Long, ByVal x As Long, ByVal y As Long) Dim pMxApp As IMxApplication Dim pDoc As IMxDocument Dim pMap As IMap Dim pIdentify As IIdentify Dim pPoint As IPoint Dim pIDArray As IArray Dim pFeatIdObj As IFeatureIdentifyObj Dim pIdObj As IIdentifyObj Set pMxApp = Application Set pDoc = Application.Document Set pMap = pDoc.FocusMap Set pIdentify = pMap.Layer(0) 'Convert x and y to map units Set pPoint = pMxApp.Display.DisplayTransformation.ToMapPoint(x, y) Set pIDArray = pIdentify.Identify(pPoint) 'Get the FeatureIdentifyObject If Not pIDArray Is Nothing Then Set pFeatIdObj = pIDArray.Element(0) Set pIdObj = pFeatIdObj pIdObj.Flash pMxApp.Display 'Report info from FeatureIdentifyObject MsgBox "Layer:" ; pIdObj.Layer.Name ; vbNewLine ; "Feature:" ; pIdObj.Name Else MsgBox "No feature identified." End If End Sub</PRE><PRE>我是初学者,对AO还不是很熟,不知道怎么转成C#的,请哪位大侠帮忙转一下啊。谢谢了</PRE> |
|
|
1楼#
发布于:2006-08-12 21:43
<P>是的 在下也是想解决同样的问题呀 ~~~~~</P>
<P>哪位高手可以帮忙下呢 </P> <P>谢谢了 </P> |
|
|
2楼#
发布于:2006-09-15 15:15
找个VB转C#软件把代码转一下就行啊!
|
|