Skip to content

Latest commit

 

History

History
95 lines (71 loc) · 6.05 KB

nf-dxgi1_2-idxgiswapchain1-setbackgroundcolor.md

File metadata and controls

95 lines (71 loc) · 6.05 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:dxgi1_2.IDXGISwapChain1.SetBackgroundColor
IDXGISwapChain1::SetBackgroundColor (dxgi1_2.h)
Changes the background color of the swap chain.
IDXGISwapChain1 interface [DXGI]
SetBackgroundColor method
IDXGISwapChain1.SetBackgroundColor
IDXGISwapChain1::SetBackgroundColor
SetBackgroundColor
SetBackgroundColor method [DXGI]
SetBackgroundColor method [DXGI]
IDXGISwapChain1 interface
direct3ddxgi.idxgiswapchain1_setbackgroundcolor
dxgi1_2/IDXGISwapChain1::SetBackgroundColor
direct3ddxgi\idxgiswapchain1_setbackgroundcolor.htm
direct3ddxgi
E46CA219-303F-40D4-8C62-6241C9199BA0
12/05/2018
IDXGISwapChain1 interface [DXGI],SetBackgroundColor method, IDXGISwapChain1.SetBackgroundColor, IDXGISwapChain1::SetBackgroundColor, SetBackgroundColor, SetBackgroundColor method [DXGI], SetBackgroundColor method [DXGI],IDXGISwapChain1 interface, direct3ddxgi.idxgiswapchain1_setbackgroundcolor, dxgi1_2/IDXGISwapChain1::SetBackgroundColor
dxgi1_2.h
Windows
Windows 8 and Platform Update for Windows 7 [desktop apps \| UWP apps]
Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps \| UWP apps]
Dxgi.lib
Windows
19H1
IDXGISwapChain1::SetBackgroundColor
dxgi1_2/IDXGISwapChain1::SetBackgroundColor
c++
APIRef
kbSyntax
COM
Dxgi.lib
Dxgi.dll
IDXGISwapChain1.SetBackgroundColor

IDXGISwapChain1::SetBackgroundColor

-description

Changes the background color of the swap chain.

-parameters

-param pColor [in]

A pointer to a DXGI_RGBA structure that specifies the background color to set.

-returns

SetBackgroundColor returns:

  • S_OK if it successfully set the background color.
  • E_INVALIDARG if the pColor parameter is incorrect, for example, pColor is NULL or any of the floating-point values of the members of DXGI_RGBA to which pColor points are outside the range from 0.0 through 1.0.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows 7:  On Windows 7 or Windows Server 2008 R2 with the Platform Update for Windows 7 installed, SetBackgroundColor fails with E_NOTIMPL. For more info about the Platform Update for Windows 7, see Platform Update for Windows 7.

-remarks

The background color affects only swap chains that you create with DXGI_SCALING_NONE in windowed mode. You pass this value in a call to IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForCoreWindow, or IDXGIFactory2::CreateSwapChainForComposition. Typically, the background color is not visible unless the swap-chain contents are smaller than the destination window.

When you set the background color, it is not immediately realized. It takes effect in conjunction with your next call to the IDXGISwapChain1::Present1 method. The DXGI_PRESENT flags that you pass to IDXGISwapChain1::Present1 can help achieve the effect that you require. For example, if you call SetBackgroundColor and then call IDXGISwapChain1::Present1 with the Flags parameter set to DXGI_PRESENT_DO_NOT_SEQUENCE, you change only the background color without changing the displayed contents of the swap chain.

When you call the IDXGISwapChain1::Present1 method to display contents of the swap chain, IDXGISwapChain1::Present1 uses the DXGI_ALPHA_MODE value that is specified in the AlphaMode member of the DXGI_SWAP_CHAIN_DESC1 structure to determine how to handle the a member of the DXGI_RGBA structure, the alpha value of the background color, that achieves window transparency. For example, if AlphaMode is DXGI_ALPHA_MODE_IGNORE, IDXGISwapChain1::Present1 ignores the a member of DXGI_RGBA.

Note  Like all presentation data, we recommend that you perform floating point operations in a linear color space. When the desktop is in a fixed bit color depth mode, the operating system converts linear color data to standard RGB data (sRGB, gamma 2.2 corrected space) to compose to the screen. For more info, see Converting data for the color space.
 

-see-also

DXGI_SCALING

IDXGISwapChain1

IDXGISwapChain1::GetBackgroundColor