流到字节数组转换

时间:2014-04-23 06:52:12

标签: c# .net windows-phone-8

我有一个选定的图像流,我想将其转换为字节。我怎么能这样做?

void photoChooserTask_Completed(object sender, PhotoResult e)
{
    if (e.TaskResult == TaskResult.OK)
    {
        MessageBox.Show(e.ChosenPhoto.Length.ToString());
 var image = new BitmapImage();
            image.SetSource(e.ChosenPhoto);

/// ????


        //Code to display the photo on the page in an image control named myImage.
        //System.Windows.Media.Imaging.BitmapImage bmp = new System.Windows.Media.Imaging.BitmapImage();
        //bmp.SetSource(e.ChosenPhoto);
        //myImage.Source = bmp;
    }
}

0 个答案:

没有答案