update:ui修改

This commit is contained in:
ltx 2025-10-09 10:22:55 +08:00
parent 4ef4da7781
commit 3abc86b451
7 changed files with 83 additions and 16 deletions

View File

@ -2,8 +2,9 @@
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"
xmlns:gif="http://wpfanimatedgif.codeplex.com"
Title="Home" Height="1080" Width="1920" Loaded="Window_Loaded">
<Grid Height="1065" VerticalAlignment="Bottom">
<Grid VerticalAlignment="Bottom">
<Grid.Background>
<ImageBrush ImageSource="/Resources/Img/Album/home_bg.png" Stretch="UniformToFill"/>
</Grid.Background>
@ -27,5 +28,44 @@
Margin="0,250,0,0"
Padding="0,100"
/>
<Grid Margin="314,803,314,0" VerticalAlignment="Top" Height="182">
<Image
Source="/Resources/Img/Album/change_back.png"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="330"
Margin="0,100,0,0"
/>
<Image
gif:ImageBehavior.AnimatedSource="/Resources/Img/Album/2.gif"
gif:ImageBehavior.RepeatBehavior="Forever"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="-20,10,30,20"
/>
<Image
Source="/Resources/Img/Album/change_right.png"
HorizontalAlignment="right"
VerticalAlignment="Top"
Width="330"
Margin="0,100,0,0"
/>
<Image
gif:ImageBehavior.AnimatedSource="/Resources/Img/Album/1.gif"
gif:ImageBehavior.RepeatBehavior="Forever"
HorizontalAlignment="right"
VerticalAlignment="Top"
Margin="50,10,200,20"
/>
</Grid>
<Image
gif:ImageBehavior.AnimatedSource="/Resources/Img/Album/3.gif"
gif:ImageBehavior.RepeatBehavior="Forever"
HorizontalAlignment="right"
VerticalAlignment="Top"
Margin="100,120,200,20"
/>
</Grid>
</Window>

View File

@ -24,12 +24,12 @@ using Yztob.AiSports.Postures.Sports;
using Yztob.AiSports.Postures.Things;
using Yztob.AiSports.Sensors.Abstractions;
using Yztob.AiSports.Sensors.Things;
namespace Wpf_AiSportsMicrospace
{
/// <summary>
/// Home.xaml 的交互逻辑
/// </summary>
///
public partial class Home : Window
{
private IHumanPredictor _humanPredictor;
@ -37,14 +37,13 @@ namespace Wpf_AiSportsMicrospace
private ConcurrentQueue<VideoFrame> _frameQueue = new();
private CancellationTokenSource _cts = new();
private SportOperate _sportOperate;
public static Uri loadingImage = new Uri("/Resources/Img/Album/1.gif", UriKind.Relative);
public Home()
{
InitializeComponent();
_humanPredictor = HumanPredictorFactory.Create(HumanPredictorType.SingleHigh);
_objectDetector = ObjectDetectorFactory.CreateSportGoodsDetector();
_humanGraphicsRenderer = new HumanGraphicsRenderer();
_humanGraphicsRenderer.DrawLabel = false;
//_sports = SportBase.GetSports();
//_detectQueue = new SportDetectionQueue();
@ -65,22 +64,25 @@ namespace Wpf_AiSportsMicrospace
// 默认选中第3张
coverFlow.SelectedIndex = 0;
//AnimationBehavior.SetSourceUri(LoadingImage, loadingImage);
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
_sportOperate = new SportOperate();
_webcamClient = _sportOperate.CreateRTSP();
//_sportOperate = new SportOperate();
//_webcamClient = _sportOperate.CreateRTSP();
_webcamClient.OnExtractFrame += frame =>
{
if (frame != null)
_frameQueue.Enqueue(frame);
};
_webcamClient.StartExtract();
//_webcamClient.OnExtractFrame += frame =>
//{
// if (frame != null)
// _frameQueue.Enqueue(frame);
//};
//_webcamClient.StartExtract();
StartFrameProcessing();
coverFlow.ProgressCompleted += CoverFlow_ProgressCompleted;
//StartFrameProcessing();
//coverFlow.ProgressCompleted += CoverFlow_ProgressCompleted;
}
private void CoverFlow_ProgressCompleted(CoverFlowItem item)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

View File

@ -9,13 +9,19 @@
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\Img\Album\1.gif" />
<None Remove="Resources\Img\Album\1.jpg" />
<None Remove="Resources\Img\Album\2.gif" />
<None Remove="Resources\Img\Album\2.jpg" />
<None Remove="Resources\Img\Album\3.gif" />
<None Remove="Resources\Img\Album\3.jpg" />
<None Remove="Resources\Img\Album\4.jpg" />
<None Remove="Resources\Img\Album\5.jpg" />
<None Remove="Resources\Img\Album\action_user.png" />
<None Remove="Resources\Img\Album\change_back.png" />
<None Remove="Resources\Img\Album\change_bg.png" />
<None Remove="Resources\Img\Album\change_left.png" />
<None Remove="Resources\Img\Album\change_right.png" />
<None Remove="Resources\Img\Album\home_bg.png" />
<None Remove="Resources\Img\Album\home_history.png" />
<None Remove="Resources\Img\Album\home_play.png" />
@ -49,6 +55,7 @@
<PackageReference Include="SkiaSharp" Version="3.119.0" />
<PackageReference Include="System.Drawing.Common" Version="9.0.9" />
<PackageReference Include="System.Speech" Version="9.0.9" />
<PackageReference Include="WpfAnimatedGif" Version="2.0.2" />
</ItemGroup>
<ItemGroup>
@ -79,12 +86,21 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Img\Album\1.gif">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\1.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\2.gif">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\2.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\3.gif">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\3.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
@ -97,9 +113,18 @@
<Resource Include="Resources\Img\Album\action_user.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\change_back.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\change_bg.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\change_left.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\change_right.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Img\Album\home_bg.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>