MediaCapture.CapturePhotoToStorageFileAsync(ImageEncodingProperties, IStorageFile) MediaCapture.CapturePhotoToStorageFileAsync(ImageEncodingProperties, IStorageFile) MediaCapture.CapturePhotoToStorageFileAsync(ImageEncodingProperties, IStorageFile) MediaCapture.CapturePhotoToStorageFileAsync(ImageEncodingProperties, IStorageFile) MediaCapture.CapturePhotoToStorageFileAsync(ImageEncodingProperties, IStorageFile) Method

Definition

Captures a photo to a storage file.

public : IAsyncAction CapturePhotoToStorageFileAsync(ImageEncodingProperties type, IStorageFile file)
IAsyncAction CapturePhotoToStorageFileAsync(ImageEncodingProperties type, IStorageFile file) const;
public IAsyncAction CapturePhotoToStorageFileAsync(ImageEncodingProperties type, IStorageFile file)
Public Function CapturePhotoToStorageFileAsync(type As ImageEncodingProperties, file As IStorageFile) As IAsyncAction
Windows.Media.Capture.MediaCapture.capturePhotoToStorageFileAsync(type, file).done( /* Your success and error handlers */ );

Parameters

type
ImageEncodingProperties ImageEncodingProperties ImageEncodingProperties

The encoding properties for the output image.

file
IStorageFile IStorageFile IStorageFile

The storage file where the image is saved.

Returns

Returns an IAsyncAction object that is used to control the asynchronous operation.

Additional features and requirements

Capabilities
webcam backgroundMediaRecording microphone

Remarks

For how-to guidance on capturing a photo to a storage file, see Basic Basic photo, video, and audio capture with MediaCapture.