Mapsui.Viewport.ScreenToWorld C# (CSharp) Method

ScreenToWorld() public method

public ScreenToWorld ( Point screenPosition ) : Point
screenPosition Point
return Point
        public Point ScreenToWorld(Point screenPosition)
        {
            return ScreenToWorld(screenPosition.X, screenPosition.Y);
        }

Same methods

Viewport::ScreenToWorld ( double screenX, double screenY ) : Point

Usage Example

 public static void Pan(Viewport view, Point currentMap, Point previousMap)
 {
     Geometries.Point current = view.ScreenToWorld(currentMap.X, currentMap.Y);
     Geometries.Point previous = view.ScreenToWorld(previousMap.X, previousMap.Y);
     double diffX = previous.X - current.X;
     double diffY = previous.Y - current.Y;
     view.Center = new Geometries.Point(view.CenterX + diffX, view.CenterY + diffY);
 }
All Usage Examples Of Mapsui.Viewport::ScreenToWorld