【问题标题】:Silverlight ImageBrush not rendering (with Bing Map Control)Silverlight ImageBrush 不渲染(使用 Bing 地图控件)
【发布时间】:2009-11-14 03:38:40
【问题描述】:

我正在尝试将图像从 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);

【问题讨论】:

    标签: wpf silverlight bing pushpin imagebrush


    【解决方案1】:

    只要我将“myImage.png”添加到背景中,我就能够看到呈现在图钉顶部的“myImage.png”。

    pp.Background = imageBrush
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多