本文整理汇总了C#中HandState.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# HandState.ToString方法的具体用法?C# HandState.ToString怎么用?C# HandState.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HandState
的用法示例。
在下文中一共展示了HandState.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Person
public Person(string ID, Point3D location, string gesture, trackingStates trackState,Joint leftHand, Joint rightHand, HandState leftHandState, HandState rightHandState, TrackingConfidence leftHandConfidence, TrackingConfidence rightHandConfidence)
{
this.ID = ID;
this.location = location;
this.gesture = gesture;
this.trackingState = (int)trackState;
this.leftHandLocation = null;
this.rightHandLocation = null;
if (leftHand.TrackingState == TrackingState.Tracked) {
this.leftHandLocation = new Point3D((double)leftHand.Position.X, (double)leftHand.Position.Y, (double)leftHand.Position.Z);
this.leftHandState = leftHandState.ToString();
this.leftHandConfidence = leftHandConfidence.ToString();
this.rightHandConfidence = rightHandConfidence.ToString();
}
if (rightHand.TrackingState == TrackingState.Tracked)
{
this.rightHandLocation = new Point3D((double)rightHand.Position.X, (double)rightHand.Position.Y, (double)rightHand.Position.Z);
this.rightHandState = rightHandState.ToString();
}
}
示例2: BuildHandMessage
public OscMessage BuildHandMessage(Body body, string key, HandState state, TrackingConfidence confidence)
{
var address = String.Format("/bodies/{0}/hands/{1}", body.TrackingId, key);
//System.Diagnostics.Debug.WriteLine(address);
return new OscMessage(address, state.ToString(), confidence.ToString());
}
示例3: DrawHand
/// <summary>
/// Draws a hand symbol if the hand is tracked: red circle = closed, green circle = opened; blue circle = lasso
/// </summary>
/// <param name="handState">state of the hand</param>
/// <param name="handPosition">position of the hand</param>
/// <param name="drawingContext">drawing context to draw to</param>
private void DrawHand(HandState handState, Point handPosition, DrawingContext drawingContext)
{
switch (handState)
{
case HandState.Closed:
drawingContext.DrawEllipse(this.handClosedBrush, null, handPosition, HandSize, HandSize);
break;
case HandState.Open:
drawingContext.DrawEllipse(this.handOpenBrush, null, handPosition, HandSize, HandSize);
break;
case HandState.Lasso:
drawingContext.DrawEllipse(this.handLassoBrush, null, handPosition, HandSize, HandSize);
break;
}
this.drawtext(drawingContext, handState.ToString(), handPosition);
}