我想保存捕获的照片放到一个文件夹如下:C#保存拍摄的照片
CameraCaptureUI captureUI = new CameraCaptureUI();
captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
captureUI.PhotoSettings.CroppedSizeInPixels = new Size(200, 200);
StorageFile photo = await
captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (photo == null)
{
// User cancelled photo capture
return;
}
StorageFolder destinationFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("ProfilePhotoFolder", CreationCollisionOption.OpenIfExists);
await photo.CopyAsync(destinationFolder, "ProfilePhoto.jpg", NameCollisionOption.ReplaceExisting);
await photo.DeleteAsync();
但是,我找不到ProfilePhotoFolder在我的文件系统。请问任何人都可以告诉我这个文件夹在哪里。这是一个通用Windows项目。
您可以放置一个断点并找出使用调试器。 – hatchet
我的猜测是通过“捕获”它是在剪贴板上:https://stackoverflow.com/questions/16965776/saving-image-form-clipboard – Sorceri
@Sorceri我刚刚更新了我的代码。我正在使用网络摄像头拍摄照片。 – EricMA