MediaCapture.GetPreviewFrameAsync Method

Definition

Overloads

GetPreviewFrameAsync()

Gets a preview frame from the capture device.

GetPreviewFrameAsync(VideoFrame)

Gets a preview frame from the capture device, copied into the provided destination VideoFrame and converted into the destination frame's format.

GetPreviewFrameAsync()

Gets a preview frame from the capture device.

public:
 virtual IAsyncOperation<VideoFrame ^> ^ GetPreviewFrameAsync() = GetPreviewFrameAsync;
/// [Windows.Foundation.Metadata.Overload("GetPreviewFrameAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<VideoFrame> GetPreviewFrameAsync();
[Windows.Foundation.Metadata.Overload("GetPreviewFrameAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<VideoFrame> GetPreviewFrameAsync();
function getPreviewFrameAsync()
Public Function GetPreviewFrameAsync () As IAsyncOperation(Of VideoFrame)

Returns

An asynchronous operation that returns a VideoFrame on successful completion.

Attributes

Windows requirements

App capabilities
backgroundMediaRecording

Remarks

This method returns the preview frame in the current format of the capture device without copying or converting the frame. To get the preview frame in another format, use the GetPreviewFrameAsync(VideoFrame) overload and pass in a VideoFrame with your desired format.

For how-to guidance on preview frames, see Get a preview frame.

Note

For app scenarios that call for capturing a large number of frames in a sequence, such as computer vision scenarios, it is recommended that you use the MediaFrameReader class instead of GetPreviewFrameAsync. For more information and how-to guidance, see Process media frames with MediaFrameReader.

See also

Applies to

GetPreviewFrameAsync(VideoFrame)

Gets a preview frame from the capture device, copied into the provided destination VideoFrame and converted into the destination frame's format.

public:
 virtual IAsyncOperation<VideoFrame ^> ^ GetPreviewFrameAsync(VideoFrame ^ destination) = GetPreviewFrameAsync;
/// [Windows.Foundation.Metadata.Overload("GetPreviewFrameCopyAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<VideoFrame> GetPreviewFrameAsync(VideoFrame const& destination);
[Windows.Foundation.Metadata.Overload("GetPreviewFrameCopyAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<VideoFrame> GetPreviewFrameAsync(VideoFrame destination);
function getPreviewFrameAsync(destination)
Public Function GetPreviewFrameAsync (destination As VideoFrame) As IAsyncOperation(Of VideoFrame)

Parameters

destination
VideoFrame

The video frame into which the preview frame will be copied.

Returns

An asynchronous operation that returns a VideoFrame on successful completion.

Attributes

Windows requirements

App capabilities
backgroundMediaRecording

Remarks

To get a preview frame without going through a copy or conversion operation, use the no argument overload of GetPreviewFrameAsync.

For how-to guidance on preview frames, see Get a preview frame.

Note

For app scenarios that call for capturing a large number of frames in a sequence, such as computer vision scenarios, it is recommended that you use the MediaFrameReader class instead of GetPreviewFrameAsync. For more information and how-to guidance, see Process media frames with MediaFrameReader.

See also

Applies to