Skip to content

Latest commit

 

History

History
120 lines (80 loc) · 4.57 KB

nf-dcomp-idcompositionsurfacefactory-createsurface.md

File metadata and controls

120 lines (80 loc) · 4.57 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:dcomp.IDCompositionSurfaceFactory.CreateSurface
IDCompositionSurfaceFactory::CreateSurface (dcomp.h)
Creates a surface object that can be associated with one or more visuals for composition.
CreateSurface
CreateSurface method [DirectComposition]
CreateSurface method [DirectComposition]
IDCompositionSurfaceFactory interface
IDCompositionSurfaceFactory interface [DirectComposition]
CreateSurface method
IDCompositionSurfaceFactory.CreateSurface
IDCompositionSurfaceFactory::CreateSurface
dcomp/IDCompositionSurfaceFactory::CreateSurface
directcomp.idcompositionsurfacefactory_createsurface
directcomp\idcompositionsurfacefactory_createsurface.htm
directcomp
C65CD072-C00E-409B-B508-C12CE4ACE73F
12/05/2018
CreateSurface, CreateSurface method [DirectComposition], CreateSurface method [DirectComposition],IDCompositionSurfaceFactory interface, IDCompositionSurfaceFactory interface [DirectComposition],CreateSurface method, IDCompositionSurfaceFactory.CreateSurface, IDCompositionSurfaceFactory::CreateSurface, dcomp/IDCompositionSurfaceFactory::CreateSurface, directcomp.idcompositionsurfacefactory_createsurface
dcomp.h
Windows
Windows 8.1 [desktop apps only]
Windows Server 2012 R2 [desktop apps only]
Dcomp.lib
Dcomp.dll
Windows
19H1
IDCompositionSurfaceFactory::CreateSurface
dcomp/IDCompositionSurfaceFactory::CreateSurface
c++
APIRef
kbSyntax
COM
Dcomp.dll
IDCompositionSurfaceFactory.CreateSurface

IDCompositionSurfaceFactory::CreateSurface

-description

Creates a surface object that can be associated with one or more visuals for composition.

-parameters

-param width [in]

The width of the surface, in pixels.

-param height [in]

The height of the surface, in pixels.

-param pixelFormat [in]

The pixel format of the surface.

-param alphaMode [in]

The format of the alpha channel, if an alpha channel is included in the pixel format. This can be one of DXGI_ALPHA_MODE_PREMULTIPLIED or DXGI_ALPHA_MODE_IGNORE. It can also be DXGI_ALPHA_MODE_UNSPECIFIED, which is interpreted as DXGI_ALPHA_MODE_IGNORE.

-param surface [out]

The newly created surface object. This parameter must not be NULL.

-returns

If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. See DirectComposition Error Codes for a list of error codes.

-remarks

A Microsoft DirectComposition surface is a rectangular array of pixels that can be associated with a visual for composition.

A newly created surface object is in an uninitialized state. While it is uninitialized, the surface has no effect on the composition of the visual tree. It behaves exactly like a surface that has 100% transparent pixels.

To initialize the surface with pixel data, use the IDCompositionSurface::BeginDraw method. The first call to this method must cover the entire surface area to provide an initial value for every pixel. Subsequent calls may specify smaller sub-rectangles of the surface to update.

This method will fail if either the width or height exceed the max texture size. If your scenario requires dimensions beyond the max texture size, use CreateVirtualSurface method.

DirectComposition surfaces support the following pixel formats:

  • DXGI_FORMAT_B8G8R8A8_UNORM
  • DXGI_FORMAT_R8G8B8A8_UNORM
  • DXGI_FORMAT_R16G16B16A16_FLOAT

-see-also

IDCompositionDevice2::CreateSurface

IDCompositionDevice2::CreateVirtualSurface

IDCompositionSurfaceFactory

IDCompositionSurfaceFactory::CreateVirtualSurface