如何在Windows Phone 8中使用StoredContact.SetDisplayPictureAsync(IInputStream流)?

时间:2013-03-08 06:25:29

标签: windows-phone-8

请参阅下面的代码,如何将IsolatedStorageFileStream-obj传输到IInputStream-obj?谢谢!

using(IsolatedStorageFileStream stream = 
   IsolatedStorageFile.GetUserStoreForApplication().OpenFile(".."), FileMode.Open))
{
    await storedContact.SetDisplayPictureAsync(stream); // compile error
}

1 个答案:

答案 0 :(得分:0)

在WP8上:

using System.IO;

using(IsolatedStorageFileStream stream = IsolatedStorageFile.GetUserStoreForApplication().OpenFile("..", FileMode.Open))
    await storedContact.SetDisplayPictureAsync(stream.AsInputStream());