开发者

Browse for image on Phone Windows Phone 7

开发者 https://www.devze.com 2023-03-15 19:52 出处:网络
I am creating Windows Phone 7 application. So far I\'ve got login to Facebook account and post tex开发者_运维百科t to my wall. I want now upload image to my feed/album.

I am creating Windows Phone 7 application. So far I've got login to Facebook account and post tex开发者_运维百科t 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);
    }
}


http://msdn.microsoft.com/en-us/library/ff769543(v=vs.92).aspx#BKMK_Photo

Should contain all you need to know.

Cheers!

0

精彩评论

暂无评论...
验证码 换一张
取 消