diff --git a/Wpf_AiSportsMicrospace/Home.xaml b/Wpf_AiSportsMicrospace/Home.xaml index c270c25..16e391a 100644 --- a/Wpf_AiSportsMicrospace/Home.xaml +++ b/Wpf_AiSportsMicrospace/Home.xaml @@ -2,9 +2,11 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Wpf_AiSportsMicrospace.MyUserControl" - Title="Home" Height="400" Width="800" Loaded="Window_Loaded"> + Title="Home" Height="1080" Width="1920" Loaded="Window_Loaded"> - - + + + + diff --git a/Wpf_AiSportsMicrospace/Home.xaml.cs b/Wpf_AiSportsMicrospace/Home.xaml.cs index 8b457ab..f82323d 100644 --- a/Wpf_AiSportsMicrospace/Home.xaml.cs +++ b/Wpf_AiSportsMicrospace/Home.xaml.cs @@ -39,13 +39,13 @@ namespace Wpf_AiSportsMicrospace public Home() { InitializeComponent(); - _humanPredictor = HumanPredictorFactory.Create(HumanPredictorType.SingleHigh); - _objectDetector = ObjectDetectorFactory.CreateSportGoodsDetector(); - _humanGraphicsRenderer = new HumanGraphicsRenderer(); - _humanGraphicsRenderer.DrawLabel = false; + //_humanPredictor = HumanPredictorFactory.Create(HumanPredictorType.SingleHigh); + //_objectDetector = ObjectDetectorFactory.CreateSportGoodsDetector(); + //_humanGraphicsRenderer = new HumanGraphicsRenderer(); + //_humanGraphicsRenderer.DrawLabel = false; - _sports = SportBase.GetSports(); - _detectQueue = new SportDetectionQueue(); + //_sports = SportBase.GetSports(); + //_detectQueue = new SportDetectionQueue(); string projectRoot = Path.Combine(AppContext.BaseDirectory, @"..\..\.."); string albumPath = Path.Combine(projectRoot, "Resources", "Img", "Album"); @@ -63,9 +63,9 @@ namespace Wpf_AiSportsMicrospace private void Window_Loaded(object sender, RoutedEventArgs e) { - _tracker = PostureCalculate.CreatePointTracker("left_wrist", 0); + //_tracker = PostureCalculate.CreatePointTracker("left_wrist", 0); - LoadRTSP(); + //LoadRTSP(); } private void LoadRTSP() diff --git a/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml b/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml index 279a0d2..1946b1e 100644 --- a/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml +++ b/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml @@ -4,8 +4,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Wpf_AiSportsMicrospace.MyUserControl" - Height="300" Width="600"> - + Height="500" Width="1080"> + @@ -23,7 +23,7 @@ - + diff --git a/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml.cs b/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml.cs index e50bd88..fc24ff9 100644 --- a/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml.cs +++ b/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml.cs @@ -26,6 +26,23 @@ namespace Wpf_AiSportsMicrospace.MyUserControl { public ObservableCollection Images { get; set; } = new ObservableCollection(); + // 添加附加属性帮助类 + public static class LayoutHelper + { + public static int GetZIndex(DependencyObject obj) + { + return (int)obj.GetValue(ZIndexProperty); + } + + public static void SetZIndex(DependencyObject obj, int value) + { + obj.SetValue(ZIndexProperty, value); + } + + public static readonly DependencyProperty ZIndexProperty = + DependencyProperty.RegisterAttached("ZIndex", typeof(int), typeof(LayoutHelper), new PropertyMetadata(0)); + } + private int _selectedIndex = 0; public int SelectedIndex { @@ -71,9 +88,9 @@ namespace Wpf_AiSportsMicrospace.MyUserControl private void UpdateLayoutWithAnimation(bool instant = false) { double centerX = ActualWidth / 2; - double spacing = 180; - double sideScale = 0.8; - double centerScale = 1.2; + double spacing = 500; + double sideScale = 0.93; + double centerScale = 1.33; for (int i = 0; i < ItemsHost.Items.Count; i++) { @@ -84,7 +101,7 @@ namespace Wpf_AiSportsMicrospace.MyUserControl if (border == null) continue; var transformGroup = border.RenderTransform as TransformGroup; - var scale = transformGroup.Children[0] as ScaleTransform; + var scale = transformGroup!.Children[0] as ScaleTransform; var translate = transformGroup.Children[1] as TranslateTransform; double targetX; @@ -93,27 +110,27 @@ namespace Wpf_AiSportsMicrospace.MyUserControl if (i == SelectedIndex) { - targetX = centerX - 75; + targetX = centerX - 190; targetScale = centerScale; targetOpacity = 1.0; } else if (i == SelectedIndex - 1 || (SelectedIndex == 0 && i == Images.Count - 1)) { // 左边图片,循环处理 - targetX = centerX - spacing - 75; + targetX = centerX - spacing - 190; targetScale = sideScale; targetOpacity = 1.0; } else if (i == SelectedIndex + 1 || (SelectedIndex == Images.Count - 1 && i == 0)) { // 右边图片,循环处理 - targetX = centerX + spacing - 75; + targetX = centerX + spacing - 190; targetScale = sideScale; targetOpacity = 1.0; } else { - targetX = centerX - 75; + targetX = centerX - 190; targetScale = sideScale; targetOpacity = 0.0; } diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/action_user.png b/Wpf_AiSportsMicrospace/Resources/Img/Album/action_user.png new file mode 100644 index 0000000..4ff4ed8 Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/Album/action_user.png differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg.png b/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg.png new file mode 100644 index 0000000..c9b07be Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg.png differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/home_history.png b/Wpf_AiSportsMicrospace/Resources/Img/Album/home_history.png index 4d58c88..36d36e7 100644 Binary files a/Wpf_AiSportsMicrospace/Resources/Img/Album/home_history.png and b/Wpf_AiSportsMicrospace/Resources/Img/Album/home_history.png differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/home_play.png b/Wpf_AiSportsMicrospace/Resources/Img/Album/home_play.png index 3fe9a57..d7fe1c1 100644 Binary files a/Wpf_AiSportsMicrospace/Resources/Img/Album/home_play.png and b/Wpf_AiSportsMicrospace/Resources/Img/Album/home_play.png differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/home_test.png b/Wpf_AiSportsMicrospace/Resources/Img/Album/home_test.png index c7f4510..41c83b5 100644 Binary files a/Wpf_AiSportsMicrospace/Resources/Img/Album/home_test.png and b/Wpf_AiSportsMicrospace/Resources/Img/Album/home_test.png differ diff --git a/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj b/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj index b0f7d6a..a9e2587 100644 --- a/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj +++ b/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj @@ -14,6 +14,12 @@ + + + + + + @@ -87,6 +93,24 @@ Always + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + Always