【问题标题】:How can I get the profile image of Windows Phone 8.1 owner's如何获取 Windows Phone 8.1 所有者的个人资料图片
【发布时间】:2014-05-07 02:21:32
【问题描述】:

我想获取 Windows Phone 用户(所有者)的图片。而且似乎有一个合适的 Api UserInformation。我试过了,但两个代码总是返回 null。我在人物应用中有个人资料图片。(但我不确定这是用UserInformation 映射的那个)

IStorageFile file1 = UserInformation.GetAccountPicture(AccountPictureKind.SmallImage);
IStorageFile file2 = UserInformation.GetAccountPicture(AccountPictureKind.LargeImage);

我的环境是

  • Windows Phone 8.1 Lumia 920 设备。
  • Visual Studio 2013 更新 2 RC

我还添加了应用程序清单。

xml <Applications> <Application Id="App" Executable="$targetnametoken$.exe"> <Extensions> <Extension Category="windows.accountPictureProvider" /> </Extensions> </Application> <Applications>

我错过了吗?

【问题讨论】:

  • 有点奇怪 - here at MSDN 图标代表桌面和电话,但 here 图标表示仅桌面。另外provided example 仅适用于桌面。
  • 我想您的项目针对的是 Windows Phone 8.1,但它是 Windows Phone Silverlight 项目还是 Windows Phone 项目? (有区别)
  • 自 Windows Phone 8 以来不再有 Windows Phone Silverlight 项目。我想问题是 Windows Phone 支持此 API,但底层 API 尚未 100% 映射到 Windows 的 API 8.1
  • @andre 目标是 windows phone 8.1。不是silverlight 8.1
  • @DanielSteiner Windows Phone Silverlight 仍然很多。 8和8.1都不少。如果您创建一个新项目(或 PCL),您可以让它以它们为目标。您还应该能够制作新的 Windows Phone Silverlight 应用程序。

标签: windows-phone-8 windows-runtime windows-phone-8.1


【解决方案1】:

不幸的是,Windows Phone 目前不存在此功能,因此该方法将始终返回 null。 MSDN 上的图标相当简单——它们仅指示该方法是否在特定平台上存在和可调用,而不是它是否完全实现了预期的行为。当然,理想情况下,备注部分应该有一条说明行为差异的注释。

【讨论】:

    猜你喜欢
    • 2017-03-03
    • 2012-01-08
    • 2014-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多