RenderTargetProperties function (d2d1helper.h)

Creates a D2D1_RENDER_TARGET_PROPERTIES structure.

Syntax

D2D1_RENDER_TARGET_PROPERTIES RenderTargetProperties(
       D2D1_RENDER_TARGET_TYPE   type,
  [in] const D2D1_PIXEL_FORMAT & pixelFormat,
       FLOAT                     dpiX,
       FLOAT                     dpiY,
       D2D1_RENDER_TARGET_USAGE  usage,
       D2D1_FEATURE_LEVEL        minLevel
);

Parameters

type

Type: D2D1_RENDER_TARGET_TYPE

A value that specifies whether the render target must use hardware rendering or software rendering. The default value, D2D1_RENDER_TARGET_TYPE_DEFAULT, specifies that hardware rendering be used; if hardware rendering is not available, the render target uses software rendering. Note that WIC bitmap render targets do not support hardware rendering.

[in] pixelFormat

Type: const D2D1_PIXEL_FORMAT

The pixel format and alpha mode of the render target. The default pixel format is D2D1::PixelFormat, which tells Direct2D to select a pixel format that is supported by the render target. For a list of pixel formats and alpha modes supported by each render target, see Supported Pixel Formats and Alpha Modes.

dpiX

Type: FLOAT

The horizontal DPI of the render target. The default value is 0.0. If both dpiX and dpiY are set to 0.0, the render target uses its default DPI. For more information, see D2D1_RENDER_TARGET_PROPERTIES.

dpiY

Type: FLOAT

The vertical DPI of the render target. The default value is 0.0. If both dpiX and dpiY are set to 0.0, the render target uses its default DPI. For more information, see D2D1_RENDER_TARGET_PROPERTIES.

usage

Type: D2D1_RENDER_TARGET_USAGE

Specifies how the render target is remotely rendered and whether it should be GDI-compatible. The default value, D2D1_RENDER_TARGET_USAGE_NONE, creates a render target that is not compatible with GDI and that uses Direct3D command-stream remote rendering, if it is available.

minLevel

Type: D2D1_FEATURE_LEVEL

The minimum Direct3D feature level that is required for hardware rendering. The default value, D2D1_FEATURE_LEVEL_DEFAULT, indicates that Direct2D should determine whether the Direct3D feature level of the device is adequate. This field is used only when ID2D1HwndRenderTarget and ID2D1DCRenderTarget objects are created. For more information, see D2D1_RENDER_TARGET_PROPERTIES.

Return value

Type: D2D1_RENDER_TARGET_PROPERTIES

A D2D1_RENDER_TARGET_PROPERTIES that contains the specified settings.

Requirements

Requirement Value
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 d2d1helper.h
Library D2d1.lib
DLL D2d1.dll

See also

D2D1_RENDER_TARGET_PROPERTIES Structure

Supported Pixel Formats and Alpha Modes