Arturo Molina
Arturo Molina

Reputation: 1059

Saving a bing map to an image file

I am trying to get the Silverlight control for Bing Maps to save an image of the map with the push pin I have added. I tried the approach described here: http://www.andybeaulieu.com/Home/tabid/67/EntryID/161/Default.aspx but I get an exception when I try to read the pixels in this line:

int pixel = bitmap.Pixels[bitmap.PixelWidth * y + x];

This is what I get:

"WriteableBitmap has protected content. Pixel access is not allowed."

I've been looking around and it seems that the problem is the maps being hosted on a different server than my "localhost".

Has anybody found a workaround for this?

P.S. I'm using VS2010 + SL4

Upvotes: 0

Views: 6228

Answers (1)

MagicMax
MagicMax

Reputation: 141

  1. you can try to use Bing's Imagery services in order to retrieve image of your location: http://msdn.microsoft.com/en-us/library/cc966738.aspx
  2. Instead of MS's WriteableBitmap try to use WriteableBitmapEx from CodePlex: http://writeablebitmapex.codeplex.com/

Upvotes: 1

Related Questions