コード例 #1
0
ファイル: CustomBone.cs プロジェクト: pi11e/KinectHTML5
        /// <summary>
        /// Constructor for a bone-class.
        /// </summary>
        /// <param name="jOne">One joint.</param>
        /// <param name="jTwo">The other joint.</param>
        public CustomBone(CustomJoint jOne, CustomJoint jTwo)
        {
            this.jOne = jOne;
            this.jTwo = jTwo;

            boneLine = new Line();
            boneLine.Stroke = System.Windows.Media.Brushes.Black;
            // the +10 is neccessary to draw the line between the centers of two ellipses (joints)
            boneLine.X1 = jOne.getX() + 10;
            boneLine.X2 = jTwo.getX() + 10;
            boneLine.Y1 = jOne.getY() + 10;
            boneLine.Y2 = jTwo.getY() + 10;
            boneLine.StrokeThickness = 3;

            // handler to react on the movement of the joints in dragging-mode
            jOne.Event_onJointIsMoving += new OnJointIsMovingHandler(OnJointOneIsMoving);
            jTwo.Event_onJointIsMoving += new OnJointIsMovingHandler(OnJointTwoIsMoving);
        }