ID2D1RenderTarget::Clear(constD2D1_COLOR_F&) method (d2d1.h)

Clears the drawing area to the specified color.

Syntax

void Clear(
  const D2D1_COLOR_F & clearColor
);

Parameters

clearColor

Type: [in] const D2D1_COLOR_F &

The color to which the drawing area is cleared.

Return value

None

Remarks

Direct2D interprets the clearColor as straight alpha (not premultiplied). If the render target's alpha mode is D2D1_ALPHA_MODE_IGNORE, the alpha channel of clearColor is ignored and replaced with 1.0f (fully opaque).

If the render target has an active clip (specified by PushAxisAlignedClip), the clear command is applied only to the area within the clip region.

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 d2d1.h
Library D2d1.lib
DLL D2d1.dll

See also

ID2D1RenderTarget