我正在尝试使用Windows表面设备拍摄并保存照片。在Windows应用商店中捕获并保存XAML/C#中的照片
我正在使用下面的代码来拍摄照片和这项工作,但我想在设备的本地驱动器上自动创建一个目录,并在没有任何对话框提示的情况下保存此照片。
所以我用捕捉到照片中的代码如下:
CameraCaptureUI camera = new CameraCaptureUI();
StorageFile file = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (file!=null)
{
using (IRandomAccessStream ras=await file.OpenAsync(FileAccessMode.Read))
{
BitmapImage source = new BitmapImage();
source.SetSource(ras);
imageBuildingPhoto.Source = source; // this is just an image control.
}
}
所以在这之后,我想会自动将图片保存到一个新的目录。例如
我的图片\ NewDirectory \ PHOTO1.JPG
任何人有任何想法我怎么能做到这一点?
这是一个使用C#4.5和XAML编写的Windows应用商店应用程序。
在此先感谢
卓越的帮助杰里杰夫。你能帮助另一个问题吗?看看这篇文章:http://stackoverflow.com/questions/15250726/create-sub-folders-in-my-pictures-from-windows-store-application – Sun 2013-03-06 17:30:56