IUIAnimationVariableIntegerChangeHandler::OnIntegerValueChanged 方法 (uianimation.h)

处理动画变量的值更改时发生的事件。

此方法以 INT32 值的形式接收更新。 若要以 DOUBLE 值的形式接收更新,请使用 IUIAnimationVariableChangeHandler::OnValueChanged 方法。

语法

HRESULT OnIntegerValueChanged(
  [in] IUIAnimationStoryboard *storyboard,
  [in] IUIAnimationVariable   *variable,
  [in] INT32                  newValue,
  [in] INT32                  previousValue
);

参数

[in] storyboard

正在对变量参数指定的动画变量进行动画处理的 情节提要

[in] variable

已更新的动画变量。

[in] newValue

动画变量的新值,根据变量的舍入模式舍入。

[in] previousValue

动画变量的上一个值,根据变量的舍入模式舍入。

返回值

如果该方法成功,则它会返回 S_OK。 否则,将返回 HRESULT 错误代码。 有关错误代码列表,请参阅 Windows 动画 错误代码。

注解

动画变量的舍入模式是使用 IUIAnimationVariable::SetRoundingMode 方法指定的。

OnIntegerValueChanged 事件的发生频率可能低于 OnValueChanged 事件,因为 2.2、2.3、2.4 等值将全部舍入为同一整数。

默认情况下,在回调方法中对任何其他动画方法的调用会导致调用失败并返回 UI_E_ILLEGAL_REENTRANCY。 但是,此默认值存在例外情况。 可以从 OnIntegerValueChanged 成功调用以下方法:

要求

要求
最低受支持的客户端 Windows 7、Windows Vista 和适用于 Windows Vista 的平台更新 [桌面应用 |UWP 应用]
最低受支持的服务器 无受支持的版本
目标平台 Windows
标头 uianimation.h
DLL UIAnimation.dll

另请参阅

IUIAnimationVariable::GetIntegerValue

IUIAnimationVariable::GetPreviousIntegerValue

IUIAnimationVariable::SetRoundingMode

IUIAnimationVariable::SetVariableIntegerChangeHandler

IUIAnimationVariableChangeHandler::OnValueChanged

IUIAnimationVariableIntegerChangeHandler

UI_ANIMATION_ROUNDING_MODE