/// <summary>TODO</summary>
 protected override void RenderMap(Graphics g)
 {
     if (g == null)
     {
         throw new ArgumentNullException("g");
     }
     using (var brush = new SolidBrush(this.BackColor)) g.FillRectangle(brush, ClientRectangle);
     g.ScaleTransform(1.0f / MapScale, 1.0f / MapScale);
     MapBuffer.Render(g, Point.Empty, ClientSize);
 }
        /// <summary>TODO</summary>
        /// <param name="delta"></param>
        /// <returns>Clipping rectangle requiring re-painting.</returns>
        protected virtual Rectangle VerticalScrollBufferedGraphics(int delta)
        {
            if (delta == 0)
            {
                return(Rectangle.Empty);
            }

//      Render(MapBuffer, MapSpare.Graphics, new Point(0,-delta));
            MapBuffer.Render(MapSpare.Graphics, new Point(0, -delta), ClientSize);
            var temp = MapBuffer; MapBuffer = MapSpare; MapSpare = temp;

            if (delta < 0)
            {
                return(new Rectangle(0, 0, ClientSize.Width, -delta));
            }
            else
            {
                return(new Rectangle(0, ClientSize.Height - delta, ClientSize.Width, delta));
            }
        }