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.

KeyTime 可以使用多种不同的格式来表示,其中包括数值时间值、百分比或 UniformPaced的特殊 sentinel 值之一。A 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

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

-或--or-

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

-或--or-

<对象**属性= "pctValue%"/><object property="pctValue%"/>

-或--or-

<对象**属性= "Uniform"/><object property="Uniform"/>

-或--or-

<对象**属性= "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.

secondsseconds
一个介于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.

适用于