public override void OnMouseDown(int Button, int Shift, int X, int Y) { // TODO: Add ToolRasterShift.OnMouseDown implementation // DownPoint = new PointClass(); IMapControl3 pMapCtr = (((IToolbarControl)m_hookHelper.Hook).Buddy) as IMapControl3; if (pMapCtr != null) { IPoint mapPoint = pMapCtr.ToMapPoint(X, Y); pMoveEnvelopeFeedback = new MoveEnvelopeFeedbackClass(); pMoveEnvelopeFeedback.Display = pMapCtr.ActiveView.ScreenDisplay; pMoveEnvelopeFeedback.Start(pRasterLayer.VisibleExtent, mapPoint); DownPoint = mapPoint; } }
private void axMapControl2_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e) { if (e.button == 1)//左键画红框 { pEn = axMapControl2.TrackRectangle(); axMapControl1.Extent = pEn; axMapControl2.DrawShape(pEn, ref oFillobject); } if (e.button == 2)//右键拖动红框 { pSmallViewerMouseDownPt = new PointClass(); pSmallViewerMouseDownPt.PutCoords(e.mapX, e.mapY); axMapControl1.CenterAt(pSmallViewerMouseDownPt); isTrackingSmallViewer = true; if (pSmallViewerEnvelope == null) { pSmallViewerEnvelope = new MoveEnvelopeFeedbackClass(); pSmallViewerEnvelope.Display = axMapControl2.ActiveView.ScreenDisplay; pSmallViewerEnvelope.Symbol = (ISymbol)oFillobject; } pSmallViewerEnvelope.Start(pEn, pSmallViewerMouseDownPt); } }
private void axMapControl2_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e) { if (e.button == 1)//左键画红框 { pEn = axMapControl2.TrackRectangle(); axMapControl1.Extent = pEn; axMapControl2.DrawShape(pEn, ref oFillobject); } if (e.button == 2)//右键拖动红框 { pSmallViewerMouseDownPt = new PointClass(); pSmallViewerMouseDownPt.PutCoords(e.mapX, e.mapY); axMapControl1.CenterAt(pSmallViewerMouseDownPt); isTrackingSmallViewer = true; if (pSmallViewerEnvelope == null) { pSmallViewerEnvelope = new MoveEnvelopeFeedbackClass(); pSmallViewerEnvelope.Display = axMapControl2.ActiveView.ScreenDisplay; pSmallViewerEnvelope.Symbol = (ISymbol)oFillobject; } pSmallViewerEnvelope.Start(pEn, pSmallViewerMouseDownPt); } }