سؤال

أحاول إضافة صورة إلى مثيل Pushpin من التحكم في خريطة 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);
هل كانت مفيدة؟

المحلول

كنت قادرا على رؤية "myimage.png" المقدمة أعلى دافعتي طالما أضيفها إلى الخلفية.

pp.Background = imageBrush
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top