开发者

Saving a bing map to an image file

I am trying to get the Silverlight control for Bing Maps to save开发者_JAVA百科 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


  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/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜