Esempio n. 1
0
 public double GetWidth()
 {
     if (FormXGIS.IsMecator)
     {
         return(XTools.GetMecatorWidth(UpRight.X, BottomLeft.X));
     }
     else
     {
         return(UpRight.X - BottomLeft.X);
     }
 }
Esempio n. 2
0
 public XVertex ToMapVertex(Point _Point)
 {
     if (FormXGIS.IsMecator)
     {
         double MapX = XTools.GetMecatorWidth(ScaleX * _Point.X, -MapMinX);
         double MapY = XTools.GetMecatorHeight(ScaleY * (WinH - _Point.Y), -MapMinY);
         return(new XVertex(MapX, MapY));
     }
     else
     {
         double MapX = ScaleX * _Point.X + MapMinX;
         double MapY = ScaleY * (WinH - _Point.Y) + MapMinY;
         return(new XVertex(MapX, MapY));
     }
 }
Esempio n. 3
0
 public Point ToScreenPoint(XVertex _Location)
 {
     if (FormXGIS.IsMecator)
     {
         double ScreenX = XTools.GetMecatorWidth(_Location.X, MapMinX) / ScaleX;
         double ScreenY = WinH - XTools.GetMecatorHeight(_Location.Y, MapMinY) / ScaleY;
         return(new Point((int)ScreenX, (int)ScreenY));
     }
     else
     {
         double ScreenX = (_Location.X - MapMinX) / ScaleX;
         double ScreenY = WinH - (_Location.Y - MapMinY) / ScaleY;
         return(new Point((int)ScreenX, (int)ScreenY));
     }
 }