ID2D1Factory::CreateWicBitmapRenderTarget method

Creates a render target that renders to a Microsoft Windows Imaging Component (WIC) bitmap.


HRESULT CreateWicBitmapRenderTarget(
  IWICBitmap                            *target,
  const D2D1_RENDER_TARGET_PROPERTIES & renderTargetProperties,
  ID2D1RenderTarget                     **renderTarget



Type: IWICBitmap*

The bitmap that receives the rendering output of the render target.



The rendering mode, pixel format, remoting options, DPI information, and the minimum DirectX support required for hardware rendering. For information about supported pixel formats, see Supported Pixel Formats and Alpha Modes.


Type: ID2D1RenderTarget**

When this method returns, contains the address of the pointer to the ID2D1RenderTarget object created by this method.

Return Value


If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


You must use D2D1_FEATURE_LEVEL_DEFAULT for the minLevel member of the renderTargetProperties parameter with this method.

Your application should create render targets once and hold onto them for the life of the application or until the D2DERR_RECREATE_TARGET error is received. When you receive this error, you need to recreate the render target (and any resources it created).

  • Applies to Windows Phone
Note   This method isn't supported on Windows Phone and will fail when called on a device with error code 0x8899000b (“There is no hardware rendering device available for this operation”). Because the Windows Phone Emulator supports WARP rendering, this method will fail when called on the emulator with a different error code, 0x88982f80 (wincodec_err_unsupportedpixelformat).


Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1.h
Library D2d1.lib
DLL D2d1.dll

See Also