2025-11-28 09:12:46 +08:00

87 lines
4.9 KiB
XML

<UserControl x:Class="Wpf_AiSportsMicrospace.Views.LongSttting"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Wpf_AiSportsMicrospace.MyUserControl"
xmlns:hc="https://handyorg.github.io/handycontrol"
Loaded="Window_Loaded"
mc:Ignorable="d" Width="1920" Height="1080">
<Grid>
<Image x:Name="videoImage" Stretch="Uniform" />
<!-- 背景网格,用于显示坐标参考 -->
<Canvas x:Name="MainCanvas" >
<!-- 网格线 -->
<Canvas.Resources>
<DrawingBrush x:Key="GridBackground" Viewport="0,0,50,50" ViewportUnits="Absolute" TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="White">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,50,50"/>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Pen>
<Pen Brush="LightGray" Thickness="0.5"/>
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="0,50"/>
<LineGeometry StartPoint="0,0" EndPoint="50,0"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Canvas.Resources>
<!--<Canvas.Background>
<StaticResource ResourceKey="GridBackground"/>
</Canvas.Background>-->
<!-- 可拖动的点 -->
<Ellipse x:Name="TopPoint1" Width="20" Height="20" Fill="Red" Cursor="Hand"
Canvas.Left="245" Canvas.Top="741" Tag="TopPoint1"/>
<Ellipse x:Name="TopPoint2" Width="20" Height="20" Fill="Red" Cursor="Hand"
Canvas.Left="1498" Canvas.Top="730" Tag="TopPoint2"/>
<Ellipse x:Name="TopPoint3" Width="20" Height="20" Fill="Red" Cursor="Hand"
Canvas.Left="1689" Canvas.Top="724" Tag="TopPoint3"/>
<Ellipse x:Name="BottomPoint1" Width="20" Height="20" Fill="Blue" Cursor="Hand"
Canvas.Left="191" Canvas.Top="918" Tag="BottomPoint1"/>
<Ellipse x:Name="BottomPoint2" Width="20" Height="20" Fill="Blue" Cursor="Hand"
Canvas.Left="1516" Canvas.Top="918" Tag="BottomPoint2"/>
<Ellipse x:Name="BottomPoint3" Width="20" Height="20" Fill="Blue" Cursor="Hand"
Canvas.Left="1722" Canvas.Top="909" Tag="BottomPoint3"/>
<!-- 坐标显示标签 -->
<hc:Tag ShowCloseButton="False" IsSelected="True" x:Name="CoordinateDisplay" Content="位置点"
Padding="18,0" FontSize="14" Visibility="Visible"/>
</Canvas>
<Button Content="返回首页" Click="Label_MouseDown" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20" Width="100" Height="30" />
<!-- 控制面板 -->
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20" Width="200">
<Border Background="#F0F0F0" Padding="15" CornerRadius="8">
<StackPanel>
<TextBlock Text="跳远点编辑器" FontSize="16" FontWeight="Bold" Margin="0,0,0,10"/>
<TextBlock Text="红色点:上边界点" Foreground="Red" FontWeight="Bold"/>
<TextBlock Text="蓝色点:下边界点" Foreground="Blue" FontWeight="Bold" Margin="0,0,0,10"/>
<Button x:Name="LoadPointsButton" Content="加载点数据" Click="LoadPointsButton_Click"
Margin="0,5" Height="30" Background="#4CAF50" Foreground="White"/>
<Button x:Name="SavePointsButton" Content="保存点数据" Click="SavePointsButton_Click"
Margin="0,5" Height="30" Background="#2196F3" Foreground="White"/>
<Button x:Name="ResetPointsButton" Content="重置为默认" Click="ResetPointsButton_Click"
Margin="0,5" Height="30" Background="#FF9800" Foreground="White"/>
<TextBlock x:Name="StatusText" Text="就绪" Margin="0,10,0,0" TextWrapping="Wrap"/>
</StackPanel>
</Border>
</StackPanel>
</Grid>
</UserControl>