【问题标题】:From Windows Phone 7.1 to Windows Phone 8.0从 Windows Phone 7.1 到 Windows Phone 8.0
【发布时间】:2015-08-20 02:34:29
【问题描述】:

我刚刚将 .cs 代码复制到了新的 Windows Phone 8.0 应用程序中。没有错误代码什么的。

我在 .cs 而不是 .xaml 中设置的应用程序上的所有图像。

当我调试项目时,没有图像。整个图像都在构造中。一切都在画布中。 E.G

       Image bankImage = new Image()
                {
                    Source = new BitmapImage(new Uri("/PhoneApp2;component/images/Menu/cash.png", UriKind.Relative)),
                    Height = 80,
                    Width = 250
                };
 Canvas.SetTop(bankImage, 140);
            Canvas.SetLeft(bankImage, 170);
MyCanvas.Children.Add(bankImage);

我的应用在 WP8 上没有图像而在 WP7 上是什么原因?

【问题讨论】:

  • VS中图片文件属性上的“Build Action”是否设置为“Resource”?

标签: windows-phone


【解决方案1】:

解决了

图像属性构建操作必须是“内容”。如果有联系,我必须获得像

这样的来源
ImageSource = (ImageSource)new BitmapImage(new Uri("/images/AmericanPoker/Bottom.png", UriKind.Relative))

无需使用 App;组件

【讨论】:

    【解决方案2】:

    不要将 .cs 文件复制到新的 WP8 项目中。 只需在较新版本的 Visual Studio(2012 或 2013)中打开旧的 WP7 项目 - 它将成为 WP8 项目。

    【讨论】:

    • 当我上传这个 .csproj 时,它的标志(不兼容)
    猜你喜欢
    • 1970-01-01
    • 2014-09-21
    • 1970-01-01
    • 1970-01-01
    • 2016-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多