Export (0) Print
Expand All
Expand Minimize

D2D1_COLOR_F

Describes the red, green, blue, and alpha components of a color.


typedef D2D_COLOR_F D2D1_COLOR_F;

Remarks

D2D1_COLOR_F is a typedef for D2D_COLOR_F, which is itself a typedef for D3DCOLORVALUE. For information about the members provided by D2D1_COLOR_F, see D3DCOLORVALUE.

The ColorF class provides a set of predefined colors and helper functions for defining colors. For more information, see the ColorF reference.

Examples

The following example uses the ColorF class to specify a predefined color (black) when creating an ID2D1SolidColorBrush.


hr = m_pRenderTarget->CreateSolidColorBrush(
    D2D1::ColorF(D2D1::ColorF::Black, 1.0f),
    &m_pBlackBrush
    );


For the complete code, see the Brush Types Example.

The next example uses the ColorF class to specify a color using red, green, blue, and alpha values.


ID2D1SolidColorBrush *pGridBrush = NULL;
hr = pCompatibleRenderTarget->CreateSolidColorBrush(
    D2D1::ColorF(D2D1::ColorF(0.93f, 0.94f, 0.96f, 1.0f)),
    &pGridBrush
    );


For the complete code, see the Simple Direct2D Application Sample.

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

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

Header

D2DBaseTypes.h (include D2d1.h)

See also

D3DCOLORVALUE
ColorF
Brush Types Example

 

 

Community Additions

ADD
Show:
© 2014 Microsoft