开发者

Silverlight ImageBrush not rendering (with Bing Map Control)

开发者 https://www.devze.com 2022-12-11 04:56 出处:网络
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 prob开发者_如何学Goably a general WPF

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 prob开发者_如何学Goably 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);


I was able to see the "myImage.png" rendered on top of my pushpin as long as I add it to the background.

pp.Background = imageBrush
0

精彩评论

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