ColorF::ColorF(UINT32, FLOAT)(UINT32, FLOAT) constructor

Instantiates a new instance of the ColorF class that contains the specified RGB and alpha values.

Syntax


ColorF(UINT32, FLOAT)(
   UINT32 rgb,
   FLOAT  a = 1.0
);

Parameters

rgb

Type: UINT32

The RGB value for the color to be constructed.

a

Type: FLOAT

The alpha value for the color to be constructed. An alpha channel value ranges from 0.0 to 1.0, where 0.0 represents a fully transparent color and 1.0 represents a fully opaque color. The default value is 1.0.

Examples

The following example creates a color by specifying its hexadecimal value.


hr = m_pRenderTarget->CreateSolidColorBrush(
    D2D1::ColorF(D2D1::ColorF(0x9ACD32, 1.0f)),  
    &m_pYellowGreenBrush
    );


Requirements

Minimum supported client

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

Minimum supported server

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

Minimum supported phone

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

Namespace

D2D1

Header

D2d1helper.h

Library

D2d1.lib

DLL

D2d1.dll

See also

ColorF
Brushes Overview

 

 

Show: