|
阅读:947回复:0
实现了IDENTIFY功能的
<P>IMap pMap;<BR> IPoint pPoint;<BR> pMap = axMapControl1.Map;<BR> pPoint = axMapControl1.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(e.x, e.y);;</P>
<P> IIdentify pIdentify;<BR> IArray pIDArray;<BR> IFeatureIdentifyObj pFeatIdObj;<BR> IIdentifyObj pIdObj;<BR> pIdentify = pMap.get_Layer(0) as IIdentify;</P> <P> IEnvelope pEnv;<BR> pEnv = new Envelope() as IEnvelope;<BR> pEnv = axMapControl1.ActiveView.Extent;<BR> pEnv.Height = 0.5;<BR> pEnv.Width =0.5;<BR> pEnv.CenterAt (pPoint);</P> <P> pIDArray = pIdentify.Identify(pEnv);</P> <P><BR> pFeatIdObj = pIDArray.get_Element(0) as IFeatureIdentifyObj ;<BR> pIdObj = pFeatIdObj as IIdentifyObj;<BR> pIdObj.Flash(axMapControl1.ActiveView.ScreenDisplay);<BR> //消息显示查询目标的信息<BR> MessageBox.Show("Layer:"+pIdObj.Layer.Name+"\r\n"+"Feature:"+pIdObj.Name);<BR> </P> |
|