Search Results for

    Show / Hide Table of Contents

    Class ViewportExtensions

    Inheritance
    object
    ViewportExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Mapsui.Extensions
    Assembly: Mapsui.dll
    Syntax
    public static class ViewportExtensions

    Methods

    | Edit this page View Source

    HasSize(Viewport)

    True if Width and Height are not zero

    Declaration
    public static bool HasSize(this Viewport viewport)
    Parameters
    Type Name Description
    Viewport viewport
    Returns
    Type Description
    bool
    | Edit this page View Source

    IsRotated(Viewport)

    IsRotated is true, when viewport displays map rotated

    Declaration
    public static bool IsRotated(this Viewport viewport)
    Parameters
    Type Name Description
    Viewport viewport
    Returns
    Type Description
    bool
    | Edit this page View Source

    ScreenToWorld(Viewport, MPoint)

    Converts a point in screen pixels to one in screen units, respecting rotation

    Declaration
    public static MPoint ScreenToWorld(this Viewport viewport, MPoint screenPosition)
    Parameters
    Type Name Description
    Viewport viewport
    MPoint screenPosition

    Coordinate in screen units

    Returns
    Type Description
    MPoint

    MPoint in world units

    | Edit this page View Source

    ScreenToWorld(Viewport, double, double)

    Converts X/Y in screen pixels to a point in screen units, respecting rotation

    Declaration
    public static MPoint ScreenToWorld(this Viewport viewport, double screenX, double screenY)
    Parameters
    Type Name Description
    Viewport viewport
    double screenX
    double screenY
    Returns
    Type Description
    MPoint

    MPoint in world units

    | Edit this page View Source

    ScreenToWorldXY(Viewport, double, double)

    Converts X/Y in screen pixels to a point in screen units, respecting rotation

    Declaration
    public static (double worldX, double worldY) ScreenToWorldXY(this Viewport viewport, double screenX, double screenY)
    Parameters
    Type Name Description
    Viewport viewport
    double screenX
    double screenY
    Returns
    Type Description
    (double x, double y)

    Tuple of x and y in world coordinates

    | Edit this page View Source

    ToExtent(Viewport)

    Calculates extent from the viewport.

    Declaration
    public static MRect ToExtent(this Viewport viewport)
    Parameters
    Type Name Description
    Viewport viewport
    Returns
    Type Description
    MRect
    Remarks

    This MRect is horizontally and vertically aligned, even if the viewport is rotated. So this MRect perhaps contain parts, that are not visible.

    | Edit this page View Source

    ToSection(Viewport)

    IsRotated is true, when viewport displays map rotated

    Declaration
    public static MSection ToSection(this Viewport viewport)
    Parameters
    Type Name Description
    Viewport viewport
    Returns
    Type Description
    MSection
    | Edit this page View Source

    WorldToScreen(Viewport, MPoint)

    Converts X/Y in world units to a point in device independent unit (or DIP or DP), respecting rotation

    Declaration
    public static MPoint WorldToScreen(this Viewport viewport, MPoint worldPosition)
    Parameters
    Type Name Description
    Viewport viewport
    MPoint worldPosition

    Coordinate in world units

    Returns
    Type Description
    MPoint

    MPoint in screen pixels

    | Edit this page View Source

    WorldToScreen(Viewport, MRect)

    Transforms the MRect from world coordinates to screen coordinates. Note, that an MRect always represents and unrotated box. If the Viewport is rotated this will result in an unrotated box that encompasses the rotated transformation.

    Declaration
    public static MRect WorldToScreen(this Viewport viewport, MRect rect)
    Parameters
    Type Name Description
    Viewport viewport

    Viewport

    MRect rect

    The MRect to transform

    Returns
    Type Description
    MRect

    Transformed rect

    | Edit this page View Source

    WorldToScreen(Viewport, double, double)

    Converts X/Y in world units to a point in device independent units (or DIP or DP), respecting rotation

    Declaration
    public static MPoint WorldToScreen(this Viewport viewport, double worldX, double worldY)
    Parameters
    Type Name Description
    Viewport viewport
    double worldX

    X coordinate in world units

    double worldY

    Y coordinate in world units

    Returns
    Type Description
    MPoint

    MPoint in screen pixels

    | Edit this page View Source

    WorldToScreenXY(Viewport, double, double)

    Converts X/Y in world units to a point in device independent units (or DIP or DP), respecting rotation

    Declaration
    public static (double screenX, double screenY) WorldToScreenXY(this Viewport viewport, double worldX, double worldY)
    Parameters
    Type Name Description
    Viewport viewport
    double worldX

    X coordinate in world units

    double worldY

    Y coordinate in world units

    Returns
    Type Description
    (double x, double y)

    Tuple of x and y in screen coordinates

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX