Large Image Display

4 posts, 0 answers
  1. Dominic
    Dominic avatar
    2 posts
    Member since:
    Mar 2017

    Posted 06 Jun Link to this post

    Hi,
    We want to use the RadMap as an instrument to display large images from hard disk by using a custom tiled map provider. Data and tile access works (using GetCachedTile and a Stream), but we have problems to adapt the coordinates.
    We'd like to have a clean way (without using code behind), adhering to the MVVM pattern, to somehow extract map coordinates at Mouse Move events.

    How can we bind or access locations?
    Do you have some ideas how to translate geo coordinates to 2D coordinates (best would be in pixels X/Y from map boarder / tile 0/0)?
    Could we avoid geo coordinates in general?

    The most important feature for us is a smooth display of tiled image data - is there a different rad control which would facilitate this?

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1402 posts

    Posted 08 Jun Link to this post

    Hello Dominic,

    To convert between mouse coordinates and map locations you can use the following methods:
    • The GetPoint() method of the Location class. It returns the screen position of the given location relative to the size of the control
    • The static GetCoordinates() method of the Location class. It returns a Location object based on screen coordinates.
    Additionally, you can check the UriImageProvider article and SDK example.

    But in general when you load a tile image from the Stream, you no longer have access to the tile's information. Or at least you cannot get this easily. Can you tell me why you need to translate the coordinates and why you want to get them in the mouse events?

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Dominic
    Dominic avatar
    2 posts
    Member since:
    Mar 2017

    Posted 09 Jun in reply to Martin Ivanov Link to this post

    Hello Martin,

    We deliberately avoided using the UriImageProvider to profit from the tile system of the TiledMapSource. Our Images can be several GB of data which are present in 16 bit. The tiles are dynamically converted to 8 bit data on the fly while loading.

    Basically, we want to create our own map from microscope images, which then has their own coordinate system in the range of mm instead of km.

    Is there the possibility to involve a strictly 2d projection instead of the MercatorProjection for the SpatialReference in our custom MapProvider?

    In the end, we'd like to get the coordinates when doing a double click on an area of interest to perform further actions. Getting the coordinates during mouse move is a bonus, but not essential.

     

    Regards,

    Dominic Tietz

  4. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1402 posts

    Posted 14 Jun Link to this post

    Hello Dominic,

    Thanks for the additional information. 

    The map's tile providers can work only with spatial coordinates. To achieve your requirement you will need to convert the 2D coordinates of the images to valid Mercator locations on the map.

    Alternatively you can check the RadDiagram control and see if it would work for your scenario. Using this control you can plot shapes on a 2D surface. Each image from your set could be a different shape on the surface. However, in this case you won't be able to use the Mercator coordinates.

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top