0
var contactStore = await ContactManager.RequestStoreAsync();
Contact Mycontact = await contactStore.GetContactAsync(contact.Id);
if (Mycontact.Thumbnail != null)
{
using (IRandomAccessStreamWithContentType stream = await Mycontact.Thumbnail.OpenReadAsync())
{
// todo: get bitmapimage
}
}
我試着用下面的代碼從UWP中獲取我的聯繫人圖片。我的問題是:我不知道如何從IRandomAccessStreamWithContentType得到一個位圖如何將IRandomAccessStreamWithContentType轉換爲BitMapImage UWP?
我怎樣才能得到它呢?
請參考[這裏](https://stackoverflow.com/questions/15328084/convert-irandomaccessstreamwithcontenttype-to-byte)的答案。 – CodingYoshi
[將IRandomAccessStreamWithContentType轉換爲字節\ [\]]的可能重複(https://stackoverflow.com/questions/15328084/convert-irandomaccessstreamwithcontenttype-to-byte) – Razor