0

I'm trying to add an image to a Pushpin instance from the Silverlight Bing Map Control, but I can't seem to get it to render (the pushpin renders fine). This is probably a general WPF question rather than anything specific to the Pushpin object.

Pushpin pp = new Pushpin();
...

Uri imageUri = new Uri(@"myImage.png", UriKind.Relative);

BitmapImage image = new BitmapImage(imageUri);

ImageBrush imageBrush = new ImageBrush();
imageBrush.ImageSource = image;

pp.Foreground = imageBrush;

myMap.Children.Add(pp);
4

1 に答える 1

0

背景に追加する限り、プッシュピンの上にレンダリングされた「myImage.png」を見ることができました。

pp.Background = imageBrush
于 2009-11-14T03:49:19.180 に答える