ID2D1CommandSink::Clear method (d2d1_1.h)

Clears the drawing area to the specified color.

Syntax

HRESULT Clear(
  [in, optional] const D2D1_COLOR_F *color
);

Parameters

[in, optional] color

Type: const D2D1_COLOR_F*

The color to which the command sink should be cleared.

Return value

Type: HRESULT

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Remarks

The clear color is restricted by the currently selected clip and layer bounds.

If no color is specified, the color should be interpreted by context. Examples include but are not limited to:

  • Transparent black for a premultiplied bitmap target.
  • Opaque black for an ignore bitmap target.
  • Containing no content (or white) for a printer page.

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1_1.h
DLL D2d1.dll

See also

ID2D1CommandList::Stream

ID2D1CommandSink

ID2D1RenderTarget::Clear