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));


Effect properties

Display name and index enumerationDescription



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.

The type is D2D1_VECTOR_4F.

The default value is {0.0f, 0.0f, 0.0f, 1.0f}.


Output bitmap

This effect generates a logically infinite sized bitmap.


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]
Libraryd2d1.lib, dxguid.lib


Related topics