KeyTime 结构

定义

在动画的相关课程中,KeyTime 实例指定特定关键帧应出现的精确时序。During the relative course of an animation, a KeyTime instance specifies the precise timing when a particular key frame should take place.

public value class KeyTime : IEquatable<System::Windows::Media::Animation::KeyTime>
[System.ComponentModel.TypeConverter(typeof(System.Windows.KeyTimeConverter))]
public struct KeyTime : IEquatable<System.Windows.Media.Animation.KeyTime>
type KeyTime = struct
Public Structure KeyTime
Implements IEquatable(Of KeyTime)
继承
KeyTime
属性
实现

注解

每个关键帧KeyTime指定关键帧结束的时间。Each key frame's KeyTime specifies when that key frame ends. 它不会指定关键时间的播放时间。It does not specify how long the key time plays. 关键帧的播放时长由关键帧的结束时间、前一个关键帧的结束时间以及动画的持续时间确定。The amount of time a key frame plays is determined by when the key frame ends, when the previous key frame ended, and the animation's duration. 有关详细信息, 请参阅关键帧动画概述See Key-Frame Animations Overview for more information.

可以用几种不同的格式来表示, 其中包括数值时间值、百分比或一个特殊的 sentinel 值UniformPacedKeyTimeA KeyTime may be expressed in several different formats, including a numeric time value, as a percentage, or as one of the special sentinel values Uniform or Paced.

XAML 属性用法XAML Attribute Usage

<对象**property= "[days.]小时:分钟:[。fractionalSeconds] "/><object property="[days.]hours:minutes:seconds[.fractionalSeconds]"/>

-or-

<对象**property= "[days.]小时:分钟"/><object property="[days.]hours:minutes"/>

- 或 --or-

<object property="pctValue%"/><object property="pctValue%"/>

-or-

<object property="Uniform"/><object property="Uniform"/>

-or-

<object property="Paced"/><object property="Paced"/>

XAML 值XAML Values

天数days
一个大于或等于0的整数值, 指定此KeyTime所跨越的天数。An integer value greater than or equal to 0 that specifies the number of days spanned by this KeyTime. 有关更多信息,请参见 TimeSpan 属性。For more information, see the TimeSpan property.

小时hours
一个介于0和23之间的整数值, 用于指定此KeyTime所跨越的小时数。An integer value between 0 and 23 that specifies the number of hours spanned by this KeyTime. 有关更多信息,请参见 TimeSpan 属性。For more information, see the TimeSpan property.

)minutes
一个介于0到59之间的整数值, 用于指定此KeyTime所跨越的分钟数。An integer value between 0 and 59 that specifies the number of minutes spanned by this KeyTime. 有关更多信息,请参见 TimeSpan 属性。For more information, see the TimeSpan property.

计算seconds
一个介于0到59之间的浮点值, 该值指定此KeyTime跨越的秒数。A floating-point value between 0 and 59 that specifies the number of seconds spanned by this KeyTime. 有关更多信息,请参见 TimeSpan 属性。For more information, see the TimeSpan property.

fractionalSecondsfractionalSeconds
由1到7位数字组成的整数值, 用于指定秒的小数部分。An integer value consisting of 1 to 7 digits that specifies fractional seconds. 有关更多信息,请参见 TimeSpan 属性。For more information, see the TimeSpan property.

pctValuepctValue
一个介于0和 100 (含) 之间的浮点值, 该值以KeyTime动画总持续时间的百分比形式指定此值。A floating-point value between 0 and 100, inclusive, that specifies this KeyTime as a percentage of the animation's total duration. 后面应跟原义字符%。有关详细信息, 请参阅Percent属性。This should be followed by the literal character %.For more information, see the Percent property.

属性

Paced

获取 Paced 值,该值产生计时行为,从而导致动画以恒定速率内插。Gets the Paced value which creates timing behavior resulting in an animation that interpolates at a constant rate.

Percent

获取以动画总持续时间的百分比表示的关键帧的结束时间。Gets the time when the key frame ends expressed as a percentage of the total duration of the animation.

TimeSpan

获取表示为相对于动画开始时间的关键帧结束时间。Gets the time when the key frame ends expressed as a time relative to the beginning of the animation.

Type

获取此实例表示的 Type 值。Gets the Type value this instance represents.

Uniform

获取 Uniform 值,该值可均匀划分关键帧之间动画的分配时间。Gets the Uniform value which divides the allotted time of the animation evenly between key frames.

方法

Equals(KeyTime)

指示此实例是否与指定的 KeyTime 相等。Indicates whether this instance is equal to the specified KeyTime.

Equals(KeyTime, KeyTime)

指示两个指定的 KeyTime 结构是否相等。Indicates whether the two specified KeyTime structures are equal.

Equals(Object)

指示此实例是否与指定的对象相等。Indicates whether this instance equals the specified object.

FromPercent(Double)

创建一个新的 KeyTime 实例,并且将 KeyTimeType 属性初始化为指定参数的值。Creates a new KeyTime instance, with the KeyTimeType property initialized to the value of the specified parameter.

FromTimeSpan(TimeSpan)

创建一个新的 KeyTime 实例,并且将 KeyTimeType 属性初始化为指定参数的值。Creates a new KeyTime instance, with the KeyTimeType property initialized to the value of the specified parameter.

GetHashCode()

返回表示此实例的整数哈希代码。Returns an integer hash code representing this instance.

ToString()

返回一个表示此 KeyTime 实例的字符串。Returns a string representing this KeyTime instance.

操作员

Equality(KeyTime, KeyTime)

重载运算符,用来比较两个 KeyTime 结构是否相等。Overloaded operator that compares two KeyTime structures for equality.

Implicit(TimeSpan to KeyTime)

重载运算符,用来将 TimeSpan 隐式转换为 KeyTimeOverloaded operator that implicitly converts a TimeSpan to a KeyTime.

Inequality(KeyTime, KeyTime)

重载运算符,用来比较两个 KeyTime 结构是否不相等。Overloaded operator that compares two KeyTime structures for inequality.

适用于