我想保存捕獲的照片放到一個文件夾如下: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