IDCompositionEffectGroup::SetOpacity(IDCompositionAnimation*) method (dcomp.h)

Animates the value of the Opacity property.

Syntax

HRESULT SetOpacity(
  [in] IDCompositionAnimation *animation
);

Parameters

[in] animation

Type: IDCompositionAnimation*

An animation that represents how the value of the Opacity property changes over time. This parameter must not be NULL.

Return value

Type: HRESULT

If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. See DirectComposition Error Codes for a list of error codes.

Remarks

This method makes a copy of the specified animation. If the object referenced by the animation parameter is changed after calling this method, the change does not affect the Opacity property unless this method is called again. If the Opacity property was previously animated, calling this method replaces the previous animation with the new animation.

This method fails if animation is an invalid pointer or if it was not created by the same IDCompositionDevice interface as the affected composition effect group. The interface cannot be a custom implementation; only interfaces created by Microsoft DirectComposition can be used with this method.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header dcomp.h
Library Dcomp.lib
DLL Dcomp.dll

See also

IDCompositionEffectGroup