This is a migrated thread and some comments may be shown as answers.

Clipping using shapefile vector data?

1 Answer 31 Views
Map
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 30 Mar 2011, 01:03 AM
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

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 01 Apr 2011, 09:54 AM
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
Tags
Map
Asked by
Matt
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or