Exemplo n.º 1
0
        /// <summary>
        /// Remember the latest point defining a zoom by rectangle.
        /// This should be called by a MouseMove handler.
        /// </summary>
        /// <param name="p">The updated position</param>
        void RectUpdate(IPosition p)
        {
            MapControl display = this.MapControl;

            // Remember the second corner for the next draw (the first
            // corner was defined by RectBegin).
            m_SecondCorner = p;

            // If we previously drew a rectangle, get rid of it by
            // re-drawing it so that it disappears
            if (!m_Rect.IsEmpty)
            {
                display.DrawReversibleFrame(m_Rect);
                m_Rect = Rectangle.Empty;
            }

            // Create new rectangle and draw it
            Window x = new Window(m_FirstCorner, m_SecondCorner);

            m_Rect = display.DrawReversibleFrame(x);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Finishes off a zoom by rectangle
        /// </summary>
        void RectFinish()
        {
            // Only do stuff if a rectangle has been defined
            if (!m_Rect.IsEmpty)
            {
                // Make the rectangle invisible
                MapControl display = this.MapControl;
                display.DrawReversibleFrame(m_Rect);
                m_Rect = Rectangle.Empty;

                // Define the new draw window
                display.SetNewWindow(new Window(m_FirstCorner, m_SecondCorner), true);
            }

            Finish();
        }