VideoFrame.CreateAsDirect3D11SurfaceBacked Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat, Int32, Int32) |
Creates a new instance of the VideoFrame class for which the image data is stored in an IDXGISurface allocated by the default Direct3D device. |
CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat, Int32, Int32, IDirect3DDevice) |
Creates a new instance of the VideoFrame class for which the image data is stored in an IDXGISurface allocated by the supplied Direct3D device. |
CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat, Int32, Int32)
Creates a new instance of the VideoFrame class for which the image data is stored in an IDXGISurface allocated by the default Direct3D device.
public:
static VideoFrame ^ CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat format, int width, int height);
/// [Windows.Foundation.Metadata.Overload("CreateAsDirect3D11SurfaceBacked")]
static VideoFrame CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat const& format, int const& width, int const& height);
[Windows.Foundation.Metadata.Overload("CreateAsDirect3D11SurfaceBacked")]
public static VideoFrame CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat format, int width, int height);
function createAsDirect3D11SurfaceBacked(format, width, height)
Public Shared Function CreateAsDirect3D11SurfaceBacked (format As DirectXPixelFormat, width As Integer, height As Integer) As VideoFrame
Parameters
- format
- DirectXPixelFormat
A value from the DirectXPixelFormat enumeration, specifying the pixel format of the created VideoFrame. Not all pixel formats are supported. See the Remarks section for more information.
- width
-
Int32
int
The width, in pixels, of the created VideoFrame.
- height
-
Int32
int
The height, in pixels, of the created VideoFrame.
Returns
A VideoFrame.
- Attributes
Windows requirements
Device family |
Windows 10, version 1803 (introduced in 10.0.17134.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v6.0)
|
Remarks
The following pixel formats, defined in the DirectXPixelFormat enumeration, are supported by VideoFrame.
- DirectXPixelFormat_R16G16B16A16UIntNormalized
- DirectXPixelFormat_R8G8B8A8UIntNormalized
- DirectXPixelFormat_B8G8R8X8UIntNormalized
- DirectXPixelFormat_B8G8R8A8UIntNormalized
- DirectXPixelFormat_NV12
- DirectXPixelFormat_P010
- DirectXPixelFormat_Yuy2
- DirectXPixelFormat_R16UIntNormalized
- DirectXPixelFormat_R8UIntNormalized
All other formats are unsupported. Attempting to create a VideoFrame with an unsupported format will cause the method to fail with a COM exception.
The overload of this method, CreateAsDirect3D11SurfaceBacked, allows you to supply the IDirect3DDevice that is used to allocate the backing surface of the video frame.
Applies to
CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat, Int32, Int32, IDirect3DDevice)
Creates a new instance of the VideoFrame class for which the image data is stored in an IDXGISurface allocated by the supplied Direct3D device.
public:
static VideoFrame ^ CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat format, int width, int height, IDirect3DDevice ^ device);
/// [Windows.Foundation.Metadata.Overload("CreateAsDirect3D11SurfaceBackedWithDevice")]
static VideoFrame CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat const& format, int const& width, int const& height, IDirect3DDevice const& device);
[Windows.Foundation.Metadata.Overload("CreateAsDirect3D11SurfaceBackedWithDevice")]
public static VideoFrame CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat format, int width, int height, IDirect3DDevice device);
function createAsDirect3D11SurfaceBacked(format, width, height, device)
Public Shared Function CreateAsDirect3D11SurfaceBacked (format As DirectXPixelFormat, width As Integer, height As Integer, device As IDirect3DDevice) As VideoFrame
Parameters
- format
- DirectXPixelFormat
A value from the DirectXPixelFormat enumeration, specifying the pixel format of the created VideoFrame. Not all pixel formats are supported. See the Remarks section for more information.
- width
-
Int32
int
The width, in pixels, of the created VideoFrame.
- height
-
Int32
int
The height, in pixels, of the created VideoFrame.
- device
- IDirect3DDevice
An IDirect3DDevice that is used to allocate the backing surface of the video frame.
Returns
A VideoFrame.
- Attributes
Windows requirements
Device family |
Windows 10, version 1803 (introduced in 10.0.17134.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v6.0)
|
Remarks
The following pixel formats, defined in the DirectXPixelFormat enumeration, are supported by VideoFrame.
- DirectXPixelFormat_R16G16B16A16UIntNormalized
- DirectXPixelFormat_R8G8B8A8UIntNormalized
- DirectXPixelFormat_B8G8R8X8UIntNormalized
- DirectXPixelFormat_B8G8R8A8UIntNormalized
- DirectXPixelFormat_NV12
- DirectXPixelFormat_P010
- DirectXPixelFormat_Yuy2
- DirectXPixelFormat_R16UIntNormalized
- DirectXPixelFormat_R8UIntNormalized
All other formats are unsupported. Attempting to create a VideoFrame with an unsupported format will cause the method to fail with a COM exception.
If the device parameter is null, the IDXGISurface is allocated using the default Direct3D device.