Silverlight ImageBrush 未渲染(使用 Bing 地图控件)
我正在尝试从 Silverlight Bing 地图控件将图像添加到图钉实例,但我似乎无法渲染它(图钉渲染得很好)。这可能是一个一般的 WPF 问题,而不是特定于 Pushpin 对象的任何问题。
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'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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要将“myImage.png”添加到背景中,我就能看到图钉顶部呈现的“myImage.png”。
I was able to see the "myImage.png" rendered on top of my pushpin as long as I add it to the background.