简体   繁体   中英

Browse for image on Phone Windows Phone 7

I am creating Windows Phone 7 application. So far I've got login to Facebook account and post text to my wall. I want now upload image to my feed/album.

How can I browse for image on the phone and then selected image upload to Facebook feed/album?

Regars

try this code somewhere in your application:

public void ShowPhotoChooser()
{
    PhotoChooserTask photoChooserTask = new PhotoChooserTask();
    photoChooserTask.Completed += new EventHandler<PhotoResult>(photoChooserTask_Completed);
    photoChooserTask.Show();
}


void photoChooserTask_Completed(object sender, PhotoResult e)
{
    if (e.TaskResult == TaskResult.OK)
    {
        System.Windows.Media.Imaging.BitmapImage bmp = 
          new System.Windows.Media.Imaging.BitmapImage();
        bmp.SetSource(e.ChosenPhoto);
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM