Exemplo n.º 1
0
        public void Update(XExtent _Extent, Rectangle _Rectangle)
        {
            //CurrentMapExtent = _Extent;
            //MapWindowSize = _Rectangle;
            //MapMinX = CurrentMapExtent.GetMinX();
            //MapMinY = CurrentMapExtent.GetMinY();
            //WinW = MapWindowSize.Width;
            //WinH = MapWindowSize.Height;
            //MapW = CurrentMapExtent.GetWidth();
            //MapH = CurrentMapExtent.GetHeight();
            //ScaleX = MapW / WinW;
            //ScaleY = MapH / WinH;
            //ScaleX = Math.Max(ScaleX, ScaleY);
            //ScaleY = ScaleX;

            CurrentMapExtent = _Extent;
            MapWindowSize    = _Rectangle;
            WinW             = MapWindowSize.Width;
            WinH             = MapWindowSize.Height;
            ScaleX           = CurrentMapExtent.GetWidth() / WinW;
            ScaleY           = CurrentMapExtent.GetHeight() / WinH;
            ScaleX           = Math.Max(ScaleX, ScaleY);
            ScaleY           = ScaleX;
            MapW             = MapWindowSize.Width * ScaleX;
            MapH             = MapWindowSize.Height * ScaleY;
            XVertex center = CurrentMapExtent.GetCenter();

            MapMinX          = center.X - MapW / 2;
            MapMinY          = center.Y - MapH / 2;
            CurrentMapExtent = new XExtent(new XVertex(MapMinX, MapMinY),
                                           new XVertex(MapMinX + MapW, MapMinY + MapH));
        }
Exemplo n.º 2
0
 public void Update(XExtent _Extent, Rectangle _Rectangle)
 {
     CurrentMapExtent = _Extent;
     MapWindowSize    = _Rectangle;
     MapMinX          = CurrentMapExtent.GetMinX();
     MapMinY          = CurrentMapExtent.GetMinY();
     WinW             = MapWindowSize.Width;
     WinH             = MapWindowSize.Height;
     MapW             = CurrentMapExtent.GetWidth();
     MapH             = CurrentMapExtent.GetHeight();
     ScaleX           = MapW / WinW;
     ScaleY           = MapH / WinH;
 }