Frage

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;
        }
    }
}
War es hilfreich?

Lösung

I can able to get the picture of the contact using the following code, try this.

    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;
    }

Hope it helps you.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top