Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ID2D1CommandSink::Clear method

Clears the drawing area to the specified color.

Syntax


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

Parameters

clearColor [in, optional]

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

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1_1.h

DLL

D2d1.dll

See also

ID2D1CommandSink
ID2D1CommandList::Stream
ID2D1RenderTarget::Clear

 

 

Community Additions

Show:
© 2014 Microsoft