C# 在Kinect骨骼上放置图像
我目前有一个功能正常的Kinect骨架。在骨骼上,我想放置角色的手臂、腿、头部等的图像。我将如何进行此操作?我想我在画骨头的时候一定要添加图像,但除此之外,我不知道该怎么做。这是我绘制骨骼的函数。任何帮助都将不胜感激C# 在Kinect骨骼上放置图像,c#,visual-studio-2010,kinect,C#,Visual Studio 2010,Kinect,我目前有一个功能正常的Kinect骨架。在骨骼上,我想放置角色的手臂、腿、头部等的图像。我将如何进行此操作?我想我在画骨头的时候一定要添加图像,但除此之外,我不知道该怎么做。这是我绘制骨骼的函数。任何帮助都将不胜感激 private void DrawBonesAndJoints(DrawingContext drawingContext) { if (this.ShowBones) { // Re
private void DrawBonesAndJoints(DrawingContext drawingContext)
{
if (this.ShowBones)
{
// Render Torso
this.DrawBone(drawingContext, JointType.Head, JointType.ShoulderCenter);
this.DrawBone(drawingContext, JointType.ShoulderCenter, JointType.ShoulderLeft);
this.DrawBone(drawingContext, JointType.ShoulderCenter, JointType.ShoulderRight);
this.DrawBone(drawingContext, JointType.ShoulderCenter, JointType.Spine);
this.DrawBone(drawingContext, JointType.Spine, JointType.HipCenter);
this.DrawBone(drawingContext, JointType.HipCenter, JointType.HipLeft);
this.DrawBone(drawingContext, JointType.HipCenter, JointType.HipRight);
// Left Arm
this.DrawBone(drawingContext, JointType.ShoulderLeft, JointType.ElbowLeft);
this.DrawBone(drawingContext, JointType.ElbowLeft, JointType.WristLeft);
this.DrawBone(drawingContext, JointType.WristLeft, JointType.HandLeft);
// Right Arm
this.DrawBone(drawingContext, JointType.ShoulderRight, JointType.ElbowRight);
this.DrawBone(drawingContext, JointType.ElbowRight, JointType.WristRight);
this.DrawBone(drawingContext, JointType.WristRight, JointType.HandRight);
// Left Leg
this.DrawBone(drawingContext, JointType.HipLeft, JointType.KneeLeft);
this.DrawBone(drawingContext, JointType.KneeLeft, JointType.AnkleLeft);
this.DrawBone(drawingContext, JointType.AnkleLeft, JointType.FootLeft);
// Right Leg
this.DrawBone(drawingContext, JointType.HipRight, JointType.KneeRight);
this.DrawBone(drawingContext, JointType.KneeRight, JointType.AnkleRight);
this.DrawBone(drawingContext, JointType.AnkleRight, JointType.FootRight);
}
if (this.ShowJoints)
{
// Render Joints
foreach (JointMapping joint in this.JointMappings.Values)
{
Brush drawBrush = null;
switch (joint.Joint.TrackingState)
{
case JointTrackingState.Tracked:
drawBrush = this.trackedJointBrush;
break;
case JointTrackingState.Inferred:
drawBrush = this.inferredJointBrush;
break;
}
if (drawBrush != null)
{
drawingContext.DrawEllipse(drawBrush, null, joint.MappedPoint, JointThickness * this.ScaleFactor, JointThickness * this.ScaleFactor);
}
}
}
}
首先通过一些基本的动画程序,如在骨骼跟踪场景中。 . 它包含您想要的内容,例如在骨骼上绘制图像