void _appContacts_SearchCompleted(object sender, ContactsSearchEventArgs e)
{
foreach (var result in e.Results)
{
var stream = result.GetPicture();
if (stream != null)
{
BitmapImage bmp = new BitmapImage();
bmp.SetSource(stream);
Image img = new Image();
img.Source = bmp;
}
}
}
答案 0 :(得分:-1)
我可以使用以下代码获取联系人的图片,试试这个。
Contact con;
private void contactListBox_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
con = ((sender as ListBox).SelectedValue as Contact);
BitmapImage img = new BitmapImage();
img.SetSource(con.GetPicture());
ContactImage.Source = img;
}
希望它对你有所帮助。