CapturedFrame CapturedFrame CapturedFrame CapturedFrame CapturedFrame Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
Represents a captured video frame.

public : sealed class CapturedFrame : IClosable, ICapturedFrame, ICapturedFrameWithSoftwareBitmap, IContentTypeProvider, IInputStream, IOutputStream, IRandomAccessStream, IRandomAccessStreamWithContentType
struct winrt::Windows::Media::Capture::CapturedFrame : IClosable, ICapturedFrame, ICapturedFrameWithSoftwareBitmap, IContentTypeProvider, IInputStream, IOutputStream, IRandomAccessStream, IRandomAccessStreamWithContentType
public sealed class CapturedFrame : IDisposable, ICapturedFrame, ICapturedFrameWithSoftwareBitmap, IContentTypeProvider, IInputStream, IOutputStream, IRandomAccessStream, IRandomAccessStreamWithContentType
Public NotInheritable Class CapturedFrame Implements IDisposable, ICapturedFrame, ICapturedFrameWithSoftwareBitmap, IContentTypeProvider, IInputStream, IOutputStream, IRandomAccessStream, IRandomAccessStreamWithContentType
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

There are several different techniques for capturing photos using the MediaCapture class, including AdvancedPhotoCapture, LowLagPhotoCapture, LowLagPhotoSequenceCapture, and VariablePhotoSequenceCapture. Though the sets of APIs used for each of these techniques vary, ultimately they all return the captured photo to you in the form of a CapturedFrame object.

Properties

BitmapProperties BitmapProperties BitmapProperties BitmapProperties BitmapProperties

Prerelease. Gets an object containing bitmap properties for the CapturedFrame. These properties convey image metadata such as EXIF data.

public : BitmapPropertySet BitmapProperties { get; }
BitmapPropertySet BitmapProperties();
public BitmapPropertySet BitmapProperties { get; }
Public ReadOnly Property BitmapProperties As BitmapPropertySet
var bitmapPropertySet = capturedFrame.bitmapProperties;
Value
BitmapPropertySet BitmapPropertySet BitmapPropertySet

An object containing bitmap properties for the CapturedFrame.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.17095.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

Remarks

This property is useful for apps that want to capture frames in an uncompressed format. When capturing to a compressed format, the bitmap properties such as EXIF data are automatically encoded into the image file. When capturing to a raw format, you can get the bitmap properties using this API and then, for example, set the BitmapProperties property of a BitmapEncoder to include the associated metadata in the encoded file.

For more information on encoding bitmaps, see Create, edit, and save bitmap images.

See Also

CanRead CanRead CanRead CanRead CanRead

Gets a value that indicates if the captured frame can be read from.

public : Platform::Boolean CanRead { get; }
bool CanRead();
public bool CanRead { get; }
Public ReadOnly Property CanRead As bool
var bool = capturedFrame.canRead;
Value
bool bool bool

true if the captured frame can be read from; otherwise, false.

CanWrite CanWrite CanWrite CanWrite CanWrite

Gets a value that indicates if the captured frame can be written to.

public : Platform::Boolean CanWrite { get; }
bool CanWrite();
public bool CanWrite { get; }
Public ReadOnly Property CanWrite As bool
var bool = capturedFrame.canWrite;
Value
bool bool bool

true if the captured frame can be written to; otherwise, false.

ContentType ContentType ContentType ContentType ContentType

Gets the content type of the captured frame.

public : Platform::String ContentType { get; }
winrt::hstring ContentType();
public string ContentType { get; }
Public ReadOnly Property ContentType As string
var string = capturedFrame.contentType;
Value
string string string

The content type of the captured frame.

ControlValues ControlValues ControlValues ControlValues ControlValues

Prerelease. Gets an object containing capture control metadata for the CapturedFrame. Capture controls adjust capture settings such as ISO and exposure.

public : CapturedFrameControlValues ControlValues { get; }
CapturedFrameControlValues ControlValues();
public CapturedFrameControlValues ControlValues { get; }
Public ReadOnly Property ControlValues As CapturedFrameControlValues
var capturedFrameControlValues = capturedFrame.controlValues;
Value
CapturedFrameControlValues CapturedFrameControlValues CapturedFrameControlValues

An object containing capture control metadata for the CapturedFrame.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.17095.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

Remarks

This property is useful for apps that want to capture frames in an uncompressed format and then base further processing on the control values with which the frame was captured. When capturing to a compressed format, the control values automatically encoded into the image file.

Height Height Height Height Height

Gets the height of the captured frame

public : unsigned int Height { get; }
uint32_t Height();
public uint Height { get; }
Public ReadOnly Property Height As uint
var uint = capturedFrame.height;
Value
uint uint uint

The height of the frame.

Position Position Position Position Position

Gets the position of the captured frame.

public : ulong Position { get; }
ulong Position();
public ulong Position { get; }
Public ReadOnly Property Position As ulong
var ulong = capturedFrame.position;
Value
ulong ulong ulong

The position of the captured frame.

Size Size Size Size Size

Gets the size of the captured frame in bytes.

public : ulong Size { get; set; }
ulong Size(); void Size(ulong size);
public ulong Size { get; set; }
Public ReadWrite Property Size As ulong
var ulong = capturedFrame.size;
capturedFrame.size = ulong;
Value
ulong ulong ulong

The size of the captured frame in bytes.

SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap

Gets a SoftwareBitmap object representing the captured frame.

public : SoftwareBitmap SoftwareBitmap { get; }
SoftwareBitmap SoftwareBitmap();
public SoftwareBitmap SoftwareBitmap { get; }
Public ReadOnly Property SoftwareBitmap As SoftwareBitmap
var softwareBitmap = capturedFrame.softwareBitmap;
Value
SoftwareBitmap SoftwareBitmap SoftwareBitmap

A SoftwareBitmap object representing the captured frame.

Width Width Width Width Width

Gets the width of the captured frame.

public : unsigned int Width { get; }
uint32_t Width();
public uint Width { get; }
Public ReadOnly Property Width As uint
var uint = capturedFrame.width;
Value
uint uint uint

The width of the captured frame.

Methods

CloneStream() CloneStream() CloneStream() CloneStream() CloneStream()

Creates a copy of the stream.

public : IRandomAccessStream CloneStream()
IRandomAccessStream CloneStream() const;
public IRandomAccessStream CloneStream()
Public Function CloneStream() As IRandomAccessStream
var iRandomAccessStream = capturedFrame.cloneStream();
Returns

Close() Close() Close() Close() Close()

Closes the captured framed object.

public : void Close()
void Close() const;
// This member is not implemented in C#
' This member is not implemented in VB.Net
// This member is not implemented in JavaScript

Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

// This member is not implemented in C++/CX
void Dispose()
Sub Dispose

FlushAsync() FlushAsync() FlushAsync() FlushAsync() FlushAsync()

Asynchronously commits and flushes all of the data of the CapturedFrame.

public : IAsyncOperation<Platform::Boolean> FlushAsync()
IAsyncOperation<bool> FlushAsync() const;
public IAsyncOperation<bool> FlushAsync()
Public Function FlushAsync() As IAsyncOperation( Of bool )
Windows.Media.Capture.CapturedFrame.flushAsync().done( /* Your success and error handlers */ );
Returns

When this method completes, a boolean value is returned which specifies true if the operation completed successfully; otherwise, false.

GetInputStreamAt(UInt64) GetInputStreamAt(UInt64) GetInputStreamAt(UInt64) GetInputStreamAt(UInt64) GetInputStreamAt(UInt64)

Gets the input stream at the specified position.

public : IInputStream GetInputStreamAt(unsigned __int64 position)
IInputStream GetInputStreamAt(UInt64 position) const;
public IInputStream GetInputStreamAt(UInt64 position)
Public Function GetInputStreamAt(position As UInt64) As IInputStream
var iInputStream = capturedFrame.getInputStreamAt(position);
Parameters
position
UInt64 UInt64 UInt64

The position in the input stream.

Returns

GetOutputStreamAt(UInt64) GetOutputStreamAt(UInt64) GetOutputStreamAt(UInt64) GetOutputStreamAt(UInt64) GetOutputStreamAt(UInt64)

Gets the output stream at the specified position.

public : IOutputStream GetOutputStreamAt(unsigned __int64 position)
IOutputStream GetOutputStreamAt(UInt64 position) const;
public IOutputStream GetOutputStreamAt(UInt64 position)
Public Function GetOutputStreamAt(position As UInt64) As IOutputStream
var iOutputStream = capturedFrame.getOutputStreamAt(position);
Parameters
position
UInt64 UInt64 UInt64

The position in the output stream.

Returns

ReadAsync(IBuffer, UInt32, InputStreamOptions) ReadAsync(IBuffer, UInt32, InputStreamOptions) ReadAsync(IBuffer, UInt32, InputStreamOptions) ReadAsync(IBuffer, UInt32, InputStreamOptions) ReadAsync(IBuffer, UInt32, InputStreamOptions)

Returns an asynchronous byte reader object.

public : IAsyncOperationWithProgress<IBuffer, unsigned int> ReadAsync(IBuffer buffer, unsigned int count, InputStreamOptions options)
IAsyncOperationWithProgress<IBuffer, uint32_t> ReadAsync(IBuffer buffer, uint32_t count, InputStreamOptions options) const;
public IAsyncOperationWithProgress<IBuffer, uint> ReadAsync(IBuffer buffer, UInt32 count, InputStreamOptions options)
Public Function ReadAsync(buffer As IBuffer, count As UInt32, options As InputStreamOptions) As IAsyncOperationWithProgress( Of IBuffer )( Of uint )
Windows.Media.Capture.CapturedFrame.readAsync(buffer, count, options).done( /* Your success and error handlers */ );
Parameters
buffer
IBuffer IBuffer IBuffer

The buffer into which the asynchronous read operation places the bytes that are read.

count
UInt32 UInt32 UInt32

The number of bytes to read that is less than or equal to the Capacity value.

options
InputStreamOptions InputStreamOptions InputStreamOptions

Specifies the type of the asynchronous read operation.

Returns

Seek(UInt64) Seek(UInt64) Seek(UInt64) Seek(UInt64) Seek(UInt64)

Seeks the stream to the specified position.

public : void Seek(unsigned __int64 position)
void Seek(UInt64 position) const;
public void Seek(UInt64 position)
Public Function Seek(position As UInt64) As void
capturedFrame.seek(position);
Parameters
position
UInt64 UInt64 UInt64

The position in the stream to seek too.

WriteAsync(IBuffer) WriteAsync(IBuffer) WriteAsync(IBuffer) WriteAsync(IBuffer) WriteAsync(IBuffer)

Asynchronously writes the specified data to the stream.

public : IAsyncOperationWithProgress<unsigned int, unsigned int> WriteAsync(IBuffer buffer)
IAsyncOperationWithProgress<uint32_t, uint32_t> WriteAsync(IBuffer buffer) const;
public IAsyncOperationWithProgress<uint, uint> WriteAsync(IBuffer buffer)
Public Function WriteAsync(buffer As IBuffer) As IAsyncOperationWithProgress( Of uint )( Of uint )
Windows.Media.Capture.CapturedFrame.writeAsync(buffer).done( /* Your success and error handlers */ );
Parameters
buffer
IBuffer IBuffer IBuffer

The data to write to the stream.

Returns

Represents an asynchronous operation that returns a result and reports progress.

See Also