Kinect虚拟试衣间开发(4)-2D衣物试穿

时间:2024-10-09 10:46:41
/// <summary> /// 调整图片大小 /// </summary> /// <param name="body">身体</param> /// <returns></returns> public void changeSize(Body body) { double shoulderwidth = (getJointScreenPoint([]).X - getJointScreenPoint([]).X); double width = 3 * shoulderwidth ; double height = 3 * shoulderwidth ; //贴图左肩与图的padding double x = getJointScreenPoint([]).X * shoulderwidth / 200; double y = getJointScreenPoint([]).Y * shoulderwidth / 200; double x1 = getJointScreenPoint([]).X-0.3*width; double y1 = getJointScreenPoint([]).Y-0.17*height; try { = width; = height; = new Thickness(x1, y1, 0, 0); }catch(ArgumentException e) { } }