Flood effect

Use the flood effect to generate a bitmap based on the specified color and alpha value. You can use this effect when you want a specific color as an input for an effect, like a background color.

Note  The effect passes along the specified color value as specified. You must manually pre-multiply the values if you plan to pass the output to effects that expect a pre-multiplied input.

The CLSID for this effect is CLSID_D2D1Flood.

The flood effect has no input image.

Example image

Example image of the flood effect outputting green.

ComPtr<ID2D1Effect> floodEffect;
m_d2dContext->CreateEffect(CLSID_D2D1Flood, &floodEffect);

floodEffect->SetValue(D2D1_FLOOD_PROP_COLOR, D2D1::Vector4F(0.0f, 1.0f, 0.0f, 1.0f));

m_d2dContext->BeginDraw();
m_d2dContext->DrawImage(floodEffect.Get());
m_d2dContext->EndDraw();

Effect properties

Display name and index enumerationType and default valueDescription

Color

D2D1_FLOOD_PROP_COLOR

D2D1_VECTOR_4F

{0.0f, 0.0f, 0.0f, 1.0f}

The color and opacity of the bitmap. This property is a D2D1_VECTOR_4F. The individual values for each channel are of type FLOAT, unbounded and unitless. The effect doesn't modify the values for the channels.

The RGBA values for each channel range from 0 to 1.

 

Output bitmap

This effect generates a logically infinite sized bitmap.

Requirements

Minimum supported clientWindows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]
Minimum supported serverWindows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]
Headerd2d1effects.h
Libraryd2d1.lib, dxguid.lib

 

Related topics

ID2D1Effect

 

 

Community Additions

ADD
Show:
© 2015 Microsoft