私はWindows 10 Mobileアプリケーションでカメラを使用しようとしていますが、写真を撮って画面に表示しようとするとエラーが発生しています。ここで windows 10 mobile camera
はコードです: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();
IRandomAccessStream stream = await photo.OpenAsync(FileAccessMode.Read);
BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);
SoftwareBitmap softwareBitmap = await decoder.GetSoftwareBitmapAsync();
SoftwareBitmap softwareBitmapBGR8 = SoftwareBitmap.Convert(softwareBitmap,
BitmapPixelFormat.Bgra8,
BitmapAlphaMode.Premultiplied);
SoftwareBitmapSource bitmapSource = new SoftwareBitmapSource();
await bitmapSource.SetBitmapAsync(softwareBitmapBGR8);
imageControl.Source = bitmapSource;
例外メッセージ:型 'System.IO.FileNotFoundException' の例外が System.Private.CoreLib.dllで発生したが、処理されなかった
ユーザーコード
追加情報:指定されたファイルが見つかりません。 (HRESULTからの例外:0x80070002が)この例外のハンドラがある場合
、プログラムが安全に継続することができる「
誰かがこれで私を助けることができる
解決しましたか? –
はい、そうでした。ありがとうございました! –