Clipping using shapefile vector data?

2 posts, 0 answers
  1. Matt
    Matt avatar
    1 posts
    Member since:
    Feb 2011

    Posted 29 Mar 2011 Link to this post

    I'm working on a project right now where we are using some Telerik controls. I'm doing some color contouring of the US and was wondering if it would be possible to somehow get the map to do masking based on the shapefile data points. Right now I have a WritableBitmap object that is colored based on some points and shades the pixels accordingly. What I want to do is try and overlay this on another layer on the rad map and perhaps have it clipped so that it fits the boundaries of the U.S. Is anything like this possible with the map control?

    EDIT: So I realized that I can put an image on the map using an InformationLayer but it isn't showing up which I think means I need to set its location on the map however I'm not sure how I can do this.

    EDIT2: Nevermind I may have figured a "good enough" solution. I ended up using QGis to merge all parts of the shapefile together then used the image as a fill on the map.

    Thanks
    Matt
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 01 Apr 2011 Link to this post

    Hi Matt,

    You can try to use your WriteableBitmap to create brush to fill map shape objects. Something like that:

    WriteableBitmap bitmap = new WriteableBitmap();
    // Prepare your bitmap somehow.
    // ...
      
    ImageBrush brush = new ImageBrush()
    {
        ImageSource = bitmap
    };
      
    MapShape shape;
    // Get or create shape you need to fill.
    // ...
      
    shape.Fill = brush;
     

    Kind regards,
    Andrey Murzov
    the Telerik team
  3. DevCraft banner
Back to Top