大便大便臭 大便大便臭
SWFU
关注数: 24 粉丝数: 29 发帖数: 244 关注贴吧数: 30
鹰眼显示问题 #region 鹰眼显示 private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e) { if (this.axMapControl1.LayerCount > 0) { axMapControl2.Map = new MapClass(); for (int i = 0; i <= this.axMapControl1.Map.LayerCount-1; i++) { this.axMapControl2.Map.AddLayer(this.axMapControl1.get_Layer(i)); } this.axMapControl2.Extent = this.axMapControl1.Extent; axMapControl2.Refresh(); } } private void axMapControl1_OnExtentUpdated(object sender, IMapControlEvents2_OnExtentUpdatedEvent e) { // 得到新范围 IEnvelope pEnvelope = (IEnvelope)e.newEnvelope; IGraphicsContainer pGraphicsContainer = axMapControl2.Map as IGraphicsContainer; IActiveView pActiveView = pGraphicsContainer as IActiveView; //在绘制前,清除axMapControl2中的任何图形元素 pGraphicsContainer.DeleteAllElements(); IRectangleElement pRectangleEle = new RectangleElementClass(); IElement pElement = pRectangleEle as IElement; pElement.Geometry = pEnvelope; //设置鹰眼图中的红线框 IRgbColor pColor = new RgbColorClass(); pColor.Red = 255; pColor.Green = 0; pColor.Blue = 0; pColor.Transparency = 255; //产生一个线符号对象 ILineSymbol pOutline = new SimpleLineSymbolClass(); pOutline.Width = 2; pOutline.Color = pColor; //设置颜色属性 pColor = new RgbColorClass(); pColor.Red = 255; pColor.Green = 0; pColor.Blue = 0; pColor.Transparency = 0; //设置填充符号的属性 IFillSymbol pFillSymbol = new SimpleFillSymbolClass(); pFillSymbol.Color = pColor; pFillSymbol.Outline = pOutline; IFillShapeElement pFillShapeEle = pElement as IFillShapeElement; pFillShapeEle.Symbol = pFillSymbol; pGraphicsContainer.AddElement((IElement)pFillShapeEle, 0); pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); } private void axMapControl2_OnMouseMove(object sender, IMapControlEvents2_OnMouseMoveEvent e) { if (e.button == 1) { IPoint pPoint = new PointClass(); pPoint.PutCoords(e.mapX, e.mapY); this.axMapControl1.CenterAt(pPoint); this.axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null); } } //鼠标点在鹰眼上的事件 private void axMapControl2_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e) { if (axMapControl2.Map.LayerCount > 0) { if (e.button == 1) { IPoint pPoint = new PointClass(); pPoint.PutCoords(e.mapX, e.mapY); axMapControl1.CenterAt(pPoint); this.axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null); } else if (e.button == 2) { IEnvelope pEnv = this.axMapControl2.TrackRectangle(); this.axMapControl1.Extent = pEnv; this.axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null); } } } #endregion 额,实在没辙了,上面这段代码,在主窗口中加载数据,鹰眼窗口无反应,然后没有框。当对鹰眼窗口和主窗口同时加载相同数据的时候,鹰眼窗口的鼠标动作可以在主窗口反应,但是同样没框,求教
1 下一页