【发布时间】:2013-11-28 00:41:12
【问题描述】:
我是 C# 新手,正在学习为 Windows Phone 8 进行开发。我正在制作一个图像编辑应用程序。 有没有办法将编辑后的图像保存在相机胶卷中而不是保存的图片中。
使用 PhotoChooserTask 会返回一个 PhotoResult。
private WriteableBitmap _imageBitmap = null;
private void Button_Click(object sender, RoutedEventArgs e)
{
PhotoChooserTask chooser = new PhotoChooserTask();
chooser.Completed += choosenImage;
chooser.Show();
}
private void choosenImage(object sender, PhotoResult e)
{
if (e.TaskResult != TaskResult.OK ) { return; }
_imageBitmap.SetSource(e.ChosenPhoto);
dummyImage.Source = _thumbImageBitmap;
//MediaLibrary library = new MediaLibrary();
//library.SavePictureToCameraRoll(String, Stream);
}
我想将此 PhotoResult(image) 保存在相机胶卷中。我做了一点研究,发现
这个方法有帮助
MediaLibrary.SavePictureToCameraRoll (String, Stream)
Save the specified image Stream as a Picture in the Windows Phone camera roll.
或
MediaLibrary.SavePictureToCameraRoll (String, Byte[])
Save the specified byte array as a Picture in the Windows Phone camera roll.
如何在我的代码中实现这个方法?
【问题讨论】:
标签: c# windows-phone-8 xna stream