Je suis en train d'enregistrer une photo prise dans un dossier comme suit:C# enregistre une photo capturée
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();
Cependant, je ne trouve pas le ProfilePhotoFolder dans mon système de fichiers. Quelqu'un pourrait-il me dire où se trouve ce dossier? Ceci est un projet Windows Universal.
Vous pouvez placer un point d'arrêt et découvrir l'utilisation du débogueur. – hatchet
Ma conjecture est que par "Capturé" il est dans le presse-papiers: https://stackoverflow.com/questions/16965776/saving-image-form-clipboard – Sorceri
@Sorceri Je viens de mettre à jour mon code. J'utilise la webcam pour capturer une photo. – EricMA