【发布时间】:2011-12-30 16:59:19
【问题描述】:
我已尝试通过以下方式添加图像,但仍然无法正常工作。图像类型是内容。
Image image = new Image();
image.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri("myimage.png", UriKind.Relative));
//Define the image display properties
image.Opacity = 1.0;
image.Stretch = Stretch.Fill;
image.Width = 40;
image.Height = 40;
// Center the image around the location specified
//Add the image to the defined map layer
phoneDetailsLayer.AddChild(image, e.Position.Location);
mapViewAll.Children.Remove(phoneDetailsLayer);
mapViewAll.Children.Add(phoneDetailsLayer);
【问题讨论】:
-
您是收到错误消息,还是没有显示?
-
没有错误信息,只是没有出现
-
检查你的图片位置和路径,我在图片属性中使用了构建操作作为资源。
-
您能否也分享一些 XAML 代码,以便我们了解您的解决方案是如何构建的?
-
奇怪,为什么所有的反对票?不满的回答者和朋友?投票赞成平衡(因为这是一个有效的问题)。
标签: windows-phone-7 map bing-maps