Hi,
I am using following code to get Thumbnail -
1. private async void GetThumbnail(Contact contact)
2. {
3. if (contact.Thumbnail != null)
4. {
5. IRandomAccessStreamWithContentType stream = await contact.Thumbnail.OpenReadAsync();
6. if (stream != null && stream.Size > 0)
7. {
8. Thumbnail = new BitmapImage();
9. Thumbnail.SetSource(stream);
10. }
11. }
12. }
At line 5 it is throwing this error. As suggested on different blog posts, I tried turning off the Firewall but no luck. Please suggest.
Update
I found that using following code works, but it is Obsolete class
var contactPicker = new ContactPicker();
var contactInfos = await contactPicker.PickMultipleContactsAsync();
foreach (var item in contactInfos)
{
var imgStream= await item.GetThumbnailAsync();
}
Can anyone explain why this is working here?