public double GetHeight() { if (FormXGIS.IsMecator) { return(XTools.GetMecatorHeight(UpRight.Y, BottomLeft.Y)); } else { return(UpRight.Y - BottomLeft.Y); } }
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)); } }
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)); } }