本文整理汇总了C#中GestureData.appendFrame方法的典型用法代码示例。如果您正苦于以下问题:C# GestureData.appendFrame方法的具体用法?C# GestureData.appendFrame怎么用?C# GestureData.appendFrame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GestureData
的用法示例。
在下文中一共展示了GestureData.appendFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getNormalizedGestureData
/// <summary>
/// Gets the normalized gesture data.
/// </summary>
/// <returns>
/// The normalized gesture data.
/// </returns>
/// <param name='resolution'>
/// Resolution to normalize to.
/// </param>
public GestureData getNormalizedGestureData(float resolution)
{
var dx = (this.maximumX - this.minimumX) * 1.0f;
var dy = (this.maximumY - this.minimumY) * 1.0f;
if (dx > dy)
dy = dx;
else
dx = dy;
GestureData normalizedData = new GestureData();
for (var i = 0; i < this.frames.Count; i++) {
GestureFrame frame = (GestureFrame)this.frames[i];
float x = (frame.position.x * 1.0f - this.minimumX) / dx * resolution;
float y = resolution - (frame.position.y * 1.0f - this.minimumY) / dy * resolution;
GestureFrame normalizedFrame = new GestureFrame(new Vector(x, y, 0.0f), frame.velocity, frame.timestamp);
normalizedData.appendFrame(normalizedFrame);
}
return normalizedData;
}