Share via


VideoFrame.CreateWithDirect3D11Surface(IDirect3DSurface) Method

Definition

Creates a new instance of the VideoFrame class for which the image data is stored in the provided IDXGISurface.

public:
 static VideoFrame ^ CreateWithDirect3D11Surface(IDirect3DSurface ^ surface);
 static VideoFrame CreateWithDirect3D11Surface(IDirect3DSurface const& surface);
public static VideoFrame CreateWithDirect3D11Surface(IDirect3DSurface surface);
function createWithDirect3D11Surface(surface)
Public Shared Function CreateWithDirect3D11Surface (surface As IDirect3DSurface) As VideoFrame

Parameters

surface
IDirect3DSurface

The IDXGISurface in which the image data is stored.

Returns

A VideoFrame.

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)

Remarks

If the surface parameter is null, an argument exception will occur. The supplied IDXGISurface must use one of the supported pixel formats. VideoFrame supports the formats corresponding to the following DirectXPixelFormat values:

  • DirectXPixelFormat_R16G16B16A16UIntNormalized
  • DirectXPixelFormat_R8G8B8A8UIntNormalized
  • DirectXPixelFormat_B8G8R8X8UIntNormalized
  • DirectXPixelFormat_B8G8R8A8UIntNormalized
  • DirectXPixelFormat_NV12
  • DirectXPixelFormat_P010
  • DirectXPixelFormat_Yuy2
  • DirectXPixelFormat_R16UIntNormalized
  • DirectXPixelFormat_R8UIntNormalized

All other formats are unsupported. If a surface with an unsupported format is specified, a COM exception will be thrown.

Applies to